本文整理汇总了Java中com.jogamp.newt.event.WindowEvent类的典型用法代码示例。如果您正苦于以下问题:Java WindowEvent类的具体用法?Java WindowEvent怎么用?Java WindowEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
WindowEvent类属于com.jogamp.newt.event包,在下文中一共展示了WindowEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: main
import com.jogamp.newt.event.WindowEvent; //导入依赖的package包/类
public static void main(String[] args) {
GLProfile glp = GLProfile.get("GL3");
GLCapabilities caps = new GLCapabilities(glp);
GLWindow glWindow = GLWindow.create(caps);
glWindow.setSize(800, 600);
glWindow.setVisible(true);
glWindow.addWindowListener(new WindowAdapter() {
public void windowDestroyNotify(WindowEvent e) {
System.exit(0);
}
});
FPSAnimator animator = new FPSAnimator(glWindow, 60);
animator.start();
}
示例2: setup
import com.jogamp.newt.event.WindowEvent; //导入依赖的package包/类
private void setup() {
GLProfile glProfile = GLProfile.get(GLProfile.GL3);
GLCapabilities glCapabilities = new GLCapabilities(glProfile);
window = GLWindow.create(glCapabilities);
window.setTitle("Hello Triangle (enhanced)");
window.setSize(1024, 768);
window.setVisible(true);
window.addGLEventListener(this);
window.addKeyListener(this);
animator = new Animator(window);
animator.start();
window.addWindowListener(new WindowAdapter() {
@Override
public void windowDestroyed(WindowEvent e) {
animator.stop();
System.exit(1);
}
});
}
示例3: createWindow
import com.jogamp.newt.event.WindowEvent; //导入依赖的package包/类
@Override
public Object createWindow(GLCapabilities caps, int width, int height) {
final Animator animator;
setAutoDrawable(glWin = GLWindow.create(caps));
setAnimator(animator = new Animator(glWin));
glWin.addWindowListener(new WindowAdapter() {
@Override
public void windowDestroyNotify(WindowEvent e) {
animator.stop();
glWin.setVisible(false);
// prevent jogl babbling about unimportant stuff
System.err.close();
System.exit(0);
}
});
glWin.setDefaultCloseOperation(WindowClosingMode.DISPOSE_ON_CLOSE);
glWin.setSize(width, height);
glWin.setTitle("bGLOOP");
return glWin;
}
示例4: setup
import com.jogamp.newt.event.WindowEvent; //导入依赖的package包/类
private void setup() {
GLProfile glProfile = GLProfile.get(GLProfile.GL3);
GLCapabilities glCapabilities = new GLCapabilities(glProfile);
window = GLWindow.create(glCapabilities);
window.setTitle("Hello Triangle (enhanced)");
window.setSize(1024, 768);
window.addGLEventListener(this);
window.addKeyListener(this);
window.setContextCreationFlags(GLContext.CTX_OPTION_DEBUG);
window.setVisible(true);
animator = new Animator(window);
animator.start();
window.addWindowListener(new WindowAdapter() {
@Override
public void windowDestroyed(WindowEvent e) {
animator.stop();
System.exit(1);
}
});
}
示例5: setup
import com.jogamp.newt.event.WindowEvent; //导入依赖的package包/类
private void setup() {
GLProfile glProfile = GLProfile.get(GLProfile.GL3);
GLCapabilities glCapabilities = new GLCapabilities(glProfile);
window = GLWindow.create(glCapabilities);
window.setTitle("Hello Globe");
window.setSize(1024, 768);
window.setContextCreationFlags(GLContext.CTX_OPTION_DEBUG);
window.setVisible(true);
window.addGLEventListener(this);
window.addKeyListener(this);
animator = new Animator(window);
animator.start();
window.addWindowListener(new WindowAdapter() {
@Override
public void windowDestroyed(WindowEvent e) {
animator.stop();
System.exit(1);
}
});
}
示例6: setup
import com.jogamp.newt.event.WindowEvent; //导入依赖的package包/类
private void setup() {
GLProfile glProfile = GLProfile.get(GLProfile.GL3);
GLCapabilities glCapabilities = new GLCapabilities(glProfile);
window = GLWindow.create(glCapabilities);
window.setTitle("Hello Texture");
window.setSize(1024, 768);
window.setVisible(true);
window.addGLEventListener(this);
window.addKeyListener(this);
animator = new Animator();
animator.add(window);
animator.start();
window.addWindowListener(new WindowAdapter() {
@Override
public void windowDestroyed(WindowEvent e) {
animator.stop();
System.exit(1);
}
});
}
示例7: setup
import com.jogamp.newt.event.WindowEvent; //导入依赖的package包/类
private void setup() {
GLProfile glProfile = GLProfile.get(GLProfile.GL3);
GLCapabilities glCapabilities = new GLCapabilities(glProfile);
window = GLWindow.create(glCapabilities);
window.setTitle("Hello Triangle (simple)");
window.setSize(1024, 768);
window.setVisible(true);
window.addGLEventListener(this);
window.addKeyListener(this);
animator = new Animator(window);
animator.start();
window.addWindowListener(new WindowAdapter() {
@Override
public void windowDestroyed(WindowEvent e) {
animator.stop();
System.exit(1);
}
});
}
示例8: main
import com.jogamp.newt.event.WindowEvent; //导入依赖的package包/类
public static void main(final String[] args) {
final GLProfile glp = GLProfile.getGL2ES2();
final GLCapabilities caps = new GLCapabilities(glp);
caps.setAlphaBits(4);
caps.setSampleBuffers(true);
caps.setNumSamples(4);
System.out.println("Requested: " + caps);
final GLWindow window = GLWindow.create(caps);
window.setPosition(10, 10);
window.setSize(800, 400);
window.setTitle("GPU UI Newt Demo 01");
final RenderState rs = RenderState.createRenderState(SVertex.factory());
final UIGLListener01 uiGLListener = new UIGLListener01 (0, rs, DEBUG, TRACE);
uiGLListener.attachInputListenerTo(window);
window.addGLEventListener(uiGLListener);
window.setVisible(true);
final Animator animator = new Animator();
animator.setUpdateFPSFrames(60, System.err);
animator.add(window);
window.addKeyListener(new KeyAdapter() {
public void keyPressed(final KeyEvent arg0) {
if(arg0.getKeyCode() == KeyEvent.VK_F4) {
window.destroy();
}
}
});
window.addWindowListener(new WindowAdapter() {
public void windowDestroyed(final WindowEvent e) {
animator.stop();
}
});
animator.start();
}
示例9: windowGainedFocus
import com.jogamp.newt.event.WindowEvent; //导入依赖的package包/类
@Override
public void windowGainedFocus(WindowEvent arg0) {
WindowInteractionListener listener = getListener();
if (listener != null) {
listener.windowGainedFocus();
}
}
示例10: windowGainedFocus
import com.jogamp.newt.event.WindowEvent; //导入依赖的package包/类
public void windowGainedFocus(final WindowEvent e) {
if(focusCount<0) { focusCount=0; }
focusCount++;
if( verbose ) {
System.err.println("FOCUS NEWT GAINED [fc "+focusCount+"]: "+prefix+", "+e);
}
}
示例11: windowLostFocus
import com.jogamp.newt.event.WindowEvent; //导入依赖的package包/类
public void windowLostFocus(final WindowEvent e) {
if(focusCount>0) { focusCount=0; }
focusCount--;
if( verbose ) {
System.err.println("FOCUS NEWT LOST [fc "+focusCount+"]: "+prefix+", "+e);
}
}
示例12: windowDestroyNotify
import com.jogamp.newt.event.WindowEvent; //导入依赖的package包/类
public void windowDestroyNotify(WindowEvent arg0) {
}
示例13: windowDestroyed
import com.jogamp.newt.event.WindowEvent; //导入依赖的package包/类
public void windowDestroyed(WindowEvent arg0) {
System.exit(0);
}
示例14: windowGainedFocus
import com.jogamp.newt.event.WindowEvent; //导入依赖的package包/类
public void windowGainedFocus(WindowEvent arg0) {
}
示例15: windowLostFocus
import com.jogamp.newt.event.WindowEvent; //导入依赖的package包/类
public void windowLostFocus(WindowEvent arg0) {
}