当前位置: 首页>>代码示例>>Java>>正文


Java WindowEvent类代码示例

本文整理汇总了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();
}
 
开发者ID:bensmith87,项目名称:jogl_gradle,代码行数:19,代码来源:Main.java

示例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);
            }
        });
    }
 
开发者ID:java-opengl-labs,项目名称:hello-triangle,代码行数:27,代码来源:HelloTriangle.java

示例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;
}
 
开发者ID:trent2,项目名称:bGLOOP,代码行数:22,代码来源:NEWTWindow.java

示例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);
            }
        });
    }
 
开发者ID:java-opengl-labs,项目名称:hello-triangle,代码行数:28,代码来源:HelloTriangle.java

示例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);
            }
        });
    }
 
开发者ID:java-opengl-labs,项目名称:hello-triangle,代码行数:28,代码来源:HelloGlobe.java

示例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);
            }
        });

    }
 
开发者ID:java-opengl-labs,项目名称:hello-triangle,代码行数:29,代码来源:HelloTexture.java

示例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);
            }
        });

    }
 
开发者ID:java-opengl-labs,项目名称:hello-triangle,代码行数:28,代码来源:HelloTriangleSimple.java

示例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();
}
 
开发者ID:java-opengl-labs,项目名称:jogl-samples,代码行数:38,代码来源:UINewtDemo01.java

示例9: windowGainedFocus

import com.jogamp.newt.event.WindowEvent; //导入依赖的package包/类
@Override
public void windowGainedFocus(WindowEvent arg0) {
	WindowInteractionListener listener = getListener();
	if (listener != null) {
		listener.windowGainedFocus();
	}
}
 
开发者ID:jaamsim,项目名称:jaamsim,代码行数:8,代码来源:Renderer.java

示例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);
    }
}
 
开发者ID:philjord,项目名称:3DTools,代码行数:8,代码来源:NEWTFocusAdapter.java

示例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);
    }
}
 
开发者ID:philjord,项目名称:3DTools,代码行数:8,代码来源:NEWTFocusAdapter.java

示例12: windowDestroyNotify

import com.jogamp.newt.event.WindowEvent; //导入依赖的package包/类
public void windowDestroyNotify(WindowEvent arg0) {
}
 
开发者ID:andreasdr,项目名称:tdme,代码行数:3,代码来源:EngineTest.java

示例13: windowDestroyed

import com.jogamp.newt.event.WindowEvent; //导入依赖的package包/类
public void windowDestroyed(WindowEvent arg0) {
	System.exit(0);
}
 
开发者ID:andreasdr,项目名称:tdme,代码行数:4,代码来源:EngineTest.java

示例14: windowGainedFocus

import com.jogamp.newt.event.WindowEvent; //导入依赖的package包/类
public void windowGainedFocus(WindowEvent arg0) {
}
 
开发者ID:andreasdr,项目名称:tdme,代码行数:3,代码来源:EngineTest.java

示例15: windowLostFocus

import com.jogamp.newt.event.WindowEvent; //导入依赖的package包/类
public void windowLostFocus(WindowEvent arg0) {
}
 
开发者ID:andreasdr,项目名称:tdme,代码行数:3,代码来源:EngineTest.java


注:本文中的com.jogamp.newt.event.WindowEvent类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。