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


Java JmeCanvasContext.setSystemListener方法代码示例

本文整理汇总了Java中com.jme3.system.JmeCanvasContext.setSystemListener方法的典型用法代码示例。如果您正苦于以下问题:Java JmeCanvasContext.setSystemListener方法的具体用法?Java JmeCanvasContext.setSystemListener怎么用?Java JmeCanvasContext.setSystemListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.jme3.system.JmeCanvasContext的用法示例。


在下文中一共展示了JmeCanvasContext.setSystemListener方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getPanel

import com.jme3.system.JmeCanvasContext; //导入方法依赖的package包/类
private Container getPanel() {
   	Dimension d3Dim = new Dimension (800, 600);
	
	AppSettings settings = new AppSettings(true);
	
	settings.setWidth(d3Dim.width);
	settings.setHeight(d3Dim.height);
	settings.setSamples(4);
	settings.setVSync(true);
	settings.setFrameRate(60);
	
	setSettings(settings);
	createCanvas();
	JmeCanvasContext ctx = (JmeCanvasContext) getContext();
	ctx.setSystemListener(this);
	
	Canvas canvas = ctx.getCanvas();
	canvas.setPreferredSize(d3Dim);
	
	JPanel panel = new JPanel(new BorderLayout());
	panel.add( canvas, BorderLayout.CENTER );
	
	return panel;
}
 
开发者ID:twak,项目名称:siteplan,代码行数:25,代码来源:Preview.java

示例2: AttitudePanel

import com.jme3.system.JmeCanvasContext; //导入方法依赖的package包/类
public AttitudePanel()
{
	super();
	
	setShowSettings(false);
	setDisplayFps(false);
       setDisplayStatView(false);
       
       setPauseOnLostFocus(false);
       
       AppSettings settings = new AppSettings(true);
	settings.setUseInput(false);
	setSettings(settings);
	
	createCanvas();
	ctx = (JmeCanvasContext) getContext();
	ctx.setSystemListener(this);
	
	ctx.getCanvas().setBackground(Color.BLACK);
	ctx.getCanvas().setFocusable(false);
	ctx.getCanvas().setSize(new Dimension(320, 240));
	
	ctx.getCanvas().setFocusable(false);
}
 
开发者ID:Jupre,项目名称:MarmaraDrone,代码行数:25,代码来源:AttitudePanel.java

示例3: EditorMain

import com.jme3.system.JmeCanvasContext; //导入方法依赖的package包/类
public EditorMain(String windowName) {
    AppSettings initSettings = new AppSettings(true);
    Dimension dim = new Dimension(1024, 768);
    initSettings.setWidth(dim.width);
    initSettings.setHeight(dim.height);

    rootFrame = new JFrame(windowName);
    rootFrame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    rootFrame.addWindowListener(new WindowAdapter() {
        @Override
        public void windowClosed(WindowEvent e) {
            stop();
        }
    });
    setSettings(initSettings);

    createCanvas(); // create canvas!
    JmeCanvasContext ctx = (JmeCanvasContext) getContext();
    ctx.getCanvas().setSize(dim);

    //-------------
    rootFrame.setJMenuBar(new JMenuBar());

    moduleControl = new ModuleControl(this);
    rootFrame.getContentPane().add(moduleControl.getContent());

    //-------------

    rootFrame.setMinimumSize(dim);
    rootFrame.pack();
    rootFrame.setLocationRelativeTo(null);
    rootFrame.setVisible(true);

    startCanvas();
    ctx.setSystemListener(this);
}
 
开发者ID:MultiverseKing,项目名称:HexGrid_JME,代码行数:37,代码来源:EditorMain.java

示例4: componentOpened

import com.jme3.system.JmeCanvasContext; //导入方法依赖的package包/类
@Override
public void componentOpened() {
    // TODO add custom code on component opening
    sceneApplication = new ViewerSceneApplication();
    sceneApplication.createCanvas();
    JmeCanvasContext ctx = (JmeCanvasContext) sceneApplication.getContext();
    ctx.setSystemListener(sceneApplication);
    Dimension dim = new Dimension(640, 480);
    ctx.getCanvas().setPreferredSize(dim);
    
    sceneApplication.startCanvas();
    
    this.add(ctx.getCanvas());
}
 
开发者ID:atomixnmc,项目名称:AtomBaseSDK,代码行数:15,代码来源:ViewerTopComponent.java

示例5: TweedFrame

import com.jme3.system.JmeCanvasContext; //导入方法依赖的package包/类
public TweedFrame() {

		instance = this;

		frame = new JFrame();

		WindowManager.register( frame );

		Dimension d3Dim = new Dimension( 1024, 640 );

		AppSettings settings = new AppSettings( true );

		settings.setWidth( d3Dim.width );
		settings.setHeight( d3Dim.height );
		settings.setSamples( 4 );
		settings.setVSync( true );
		settings.setFrameRate( 60 );

		tweed = new Tweed( this );
		tweed.setSettings( settings );
		tweed.createCanvas();
		JmeCanvasContext ctx = (JmeCanvasContext) tweed.getContext();
		ctx.setSystemListener( tweed );

		canvas = ctx.getCanvas();
		canvas.setPreferredSize( d3Dim );

		frame.setLayout( new BorderLayout() );
		frame.add( buildUI(), BorderLayout.EAST );
		frame.add( canvas, BorderLayout.CENTER );
		frame.setExtendedState( frame.getExtendedState() | JFrame.MAXIMIZED_BOTH );

		frame.addWindowListener( new WindowAdapter() {
			public void windowClosing( WindowEvent e ) {
				TweedSettings.save(true);
				Tweed.deleteScratch();
			};
		} );

		scheduler.scheduleAtFixedRate( new Runnable() {
			@Override
			public void run() {
				TweedSettings.save(true);
			}
		}, 30, 30, TimeUnit.SECONDS );

		scheduler.scheduleAtFixedRate( new Runnable() {
			@Override
			public void run() {
				Vector3d pt = tweed.cursorPosition;
				if ( coordLabel != null && TweedSettings.settings.trans != null) {
					worldLabel.setText( pt == null ? "..." : String.format( "%.4f, %.4f ", 
							pt.x, 
							pt.z) );
					coordLabel.setText( pt == null ? "..." : String.format( "%.4f, %.4f ", 
							pt.x + TweedSettings.settings.trans[0], 
							pt.z + TweedSettings.settings.trans[1]) );
					crsLabel.setText(TweedSettings.settings.gmlCoordSystem);
				}

				JFrame.setDefaultLookAndFeelDecorated( true );

			}
		}, 100, 100, TimeUnit.MILLISECONDS );

		frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
		frame.pack();
		frame.setVisible( !HEADLESS );

		tweed.startCanvas();
	}
 
开发者ID:twak,项目名称:chordatlas,代码行数:72,代码来源:TweedFrame.java

示例6: SandboxFrame

import com.jme3.system.JmeCanvasContext; //导入方法依赖的package包/类
/**
 * Creates new form SandboxFrame
 */
public SandboxFrame() {
    JPopupMenu.setDefaultLightWeightPopupEnabled(false);
    KeyboardFocusManager kfm = KeyboardFocusManager.getCurrentKeyboardFocusManager();
    kfm.addKeyEventDispatcher(new DAEKeyboardManager());
    initComponents();
    cboTranslateSpace.setModel(new DefaultComboBoxModel(TranslateGizmoSpace.values()));
    cboRotateSpace.setModel(new DefaultComboBoxModel(RotateGizmoSpace.values()));

    cboTranslateSpace.setSelectedItem(TranslateGizmoSpace.LOCAL);
    cboRotateSpace.setSelectedItem(RotateGizmoSpace.LOCAL);

    cboTranslateSpace.setRenderer(new TransformSpaceRenderer());
    cboRotateSpace.setRenderer(new TransformSpaceRenderer());

    SwingUtilities.updateComponentTreeUI(this);
    GlobalObjects.getInstance().registerListener(this);

    AppSettings settings = new AppSettings(true);
    settings.setWidth(640);
    settings.setHeight(480);
    settings.setVSync(true);

    //settings.set
    viewport = new SandboxViewport();
    viewport.setSettings(settings);

    viewport.createCanvas(); // create canvas!
    JmeCanvasContext ctx = (JmeCanvasContext) viewport.getContext();
    ctx.setSystemListener(viewport);
    Dimension dim = new Dimension(640, 480);
    ctx.getCanvas().setPreferredSize(dim);
    ctx.getCanvas().setMinimumSize(new Dimension(320, 240));
    DropTarget dropTarget = new DropTarget(ctx.getCanvas(), this);
    viewport.startCanvas();

    pnlViewPort.setLeftComponent(ctx.getCanvas());
    propertiesPanel1.validate();

    createProjectDialog = new CreateProjectDialog(this, true);
    createObjectDialog = new CreateKlatchDialog(this, true);
    createObjectDialog.setExtension("rig");
}
 
开发者ID:samynk,项目名称:DArtE,代码行数:46,代码来源:SandboxFrame.java


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