當前位置: 首頁>>代碼示例>>Java>>正文


Java AppSettings.setWidth方法代碼示例

本文整理匯總了Java中com.jme3.system.AppSettings.setWidth方法的典型用法代碼示例。如果您正苦於以下問題:Java AppSettings.setWidth方法的具體用法?Java AppSettings.setWidth怎麽用?Java AppSettings.setWidth使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.jme3.system.AppSettings的用法示例。


在下文中一共展示了AppSettings.setWidth方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: Viewer

import com.jme3.system.AppSettings; //導入方法依賴的package包/類
public Viewer() throws Exception{
	setShowSettings(false);
	AppSettings settings=new AppSettings(true);
	settings.setResizable(true);
	settings.setFrameRate(15);
	settings.setWidth(640);
	settings.setHeight(480);
	settings.setTitle("Image Viewer");

	reloadImage(null);

	int w=IMAGE.getImage().getWidth();
	int h=IMAGE.getImage().getHeight();
	GraphicsDevice gd=GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();

	if(w<gd.getDisplayMode().getWidth()/2&&h<gd.getDisplayMode().getHeight()){
		settings.setWidth(w);
		settings.setHeight(h);
	}

	setSettings(settings);

}
 
開發者ID:riccardobl,項目名稱:DDSWriter,代碼行數:24,代碼來源:Viewer.java

示例2: createCanvas

import com.jme3.system.AppSettings; //導入方法依賴的package包/類
public Canvas createCanvas() {
    String appClass = TestEditor.class.getName();
    AppSettings settings = new AppSettings(true);
    settings.setWidth(640);
    settings.setHeight(480);
    settings.setFrameRate(30);

    try {
        Class<? extends LegacyApplication> clazz = (Class<? extends LegacyApplication>) Class.forName(appClass);
        app = clazz.newInstance();
        app.setPauseOnLostFocus(false);
        app.setSettings(settings);
        app.createCanvas();
        app.startCanvas();

        JmeCanvasContext context = (JmeCanvasContext) app.getContext();
        Canvas canvas = context.getCanvas();
        canvas.setSize(settings.getWidth(), settings.getHeight());

        return canvas;
    } catch (ClassNotFoundException | InstantiationException | IllegalAccessException ex) {
        ex.printStackTrace();
    }
    return null;
}
 
開發者ID:huliqing,項目名稱:LuoYing,代碼行數:26,代碼來源:TestSwing2.java

示例3: createCanvas

import com.jme3.system.AppSettings; //導入方法依賴的package包/類
public static Canvas createCanvas() {
    String appClass = TestEditor.class.getName();
    AppSettings settings = new AppSettings(true);
    settings.setWidth(640);
    settings.setHeight(480);
    settings.setFrameRate(60);

    try {
        Class<? extends LegacyApplication> clazz = (Class<? extends LegacyApplication>) Class.forName(appClass);
        LegacyApplication app = clazz.newInstance();
        app.setPauseOnLostFocus(false);
        app.setSettings(settings);
        app.createCanvas();
        app.startCanvas();

        JmeCanvasContext context = (JmeCanvasContext) app.getContext();
        Canvas canvas = context.getCanvas();
        canvas.setSize(settings.getWidth(), settings.getHeight());

        return canvas;
    } catch (ClassNotFoundException | InstantiationException | IllegalAccessException ex) {
        ex.printStackTrace();
    }
    
    return null;
}
 
開發者ID:huliqing,項目名稱:LuoYing,代碼行數:27,代碼來源:SwingUtils.java

示例4: start

import com.jme3.system.AppSettings; //導入方法依賴的package包/類
@Override
public void start()
{
	DisplayPrefsItem dprefs = new DisplayPrefsItem();
	AppSettings settings = new AppSettings(true);
	settings.setTitle("Multiplicity v3.0");
	settings.setBitsPerPixel(dprefs.getBitsPerPixel());
	settings.setWidth(dprefs.getWidth());
	settings.setHeight(dprefs.getHeight());
	settings.setFullscreen(dprefs.getFullScreen());
	settings.setVSync(true);
	settings.setSamples(dprefs.getMinimumAntiAliasSamples());
	setSettings(settings);

	super.start();
}
 
開發者ID:synergynet,項目名稱:synergynet3.1,代碼行數:17,代碼來源:JMEAppRoot.java

示例5: main

import com.jme3.system.AppSettings; //導入方法依賴的package包/類
/**
 * @param args
 */
public static void main(String[] args) {
	JOryx oryx = new JOryx();
	singleton = oryx;
	AppSettings a = new AppSettings(true);
	SettingsState ss = SettingsState.getSingleton();
	ss.loadSettings();
	a.setTitle("Realm of the Mad God");
	a.setWidth(ss.width);
	a.setHeight(ss.height);
	a.setFullscreen(ss.fullscreen);
	a.setRenderer(AppSettings.LWJGL_OPENGL1);
	oryx.setSettings(a);
	oryx.setPauseOnLostFocus(false);
	oryx.start();
}
 
開發者ID:AMPBEdu,項目名稱:gjOryx,代碼行數:19,代碼來源:JOryx.java

示例6: getPanel

import com.jme3.system.AppSettings; //導入方法依賴的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

示例7: createCanvas

import com.jme3.system.AppSettings; //導入方法依賴的package包/類
private void createCanvas() {
	AppSettings settings = new AppSettings(true);
	settings.setWidth(640);
	settings.setHeight(480);
	settings.setFrameRate(60);

	config = Util.getConfig();

	viewer = new Viewer();
	viewer.setPauseOnLostFocus(false);
	viewer.setSettings(settings);
	viewer.createCanvas();
	viewer.startCanvas();

	context = (JmeCanvasContext) viewer.getContext();
	canvas = context.getCanvas();
	canvas.setSize(settings.getWidth(), settings.getHeight());
}
 
開發者ID:morris,項目名稱:vstools-java,代碼行數:19,代碼來源:GUI.java

示例8: main

import com.jme3.system.AppSettings; //導入方法依賴的package包/類
public static void main(String[] args) throws InterruptedException{
    AppSettings settings = new AppSettings(true);
    settings.setWidth(640);
    settings.setHeight(480);

    final TestSafeCanvas app = new TestSafeCanvas();
    app.setPauseOnLostFocus(false);
    app.setSettings(settings);
    app.createCanvas();
    app.startCanvas(true);

    JmeCanvasContext context = (JmeCanvasContext) app.getContext();
    Canvas canvas = context.getCanvas();
    canvas.setSize(settings.getWidth(), settings.getHeight());

    

    Thread.sleep(3000);

    JFrame frame = new JFrame("Test");
    frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    frame.addWindowListener(new WindowAdapter() {
        @Override
        public void windowClosing(WindowEvent e) {
            app.stop();
        }
    });
    frame.getContentPane().add(canvas);
    frame.pack();
    frame.setLocationRelativeTo(null);
    frame.setVisible(true);

    Thread.sleep(3000);

    frame.getContentPane().remove(canvas);

    Thread.sleep(3000);

    frame.getContentPane().add(canvas);
}
 
開發者ID:mleoking,項目名稱:PhET,代碼行數:41,代碼來源:TestSafeCanvas.java

示例9: TestPhysics

import com.jme3.system.AppSettings; //導入方法依賴的package包/類
public TestPhysics(){
    settings = new AppSettings(true);
    settings.setWidth(1280);
    settings.setHeight(720);
    settings.setTitle("Cubes Demo - Physics");
    settings.setFrameRate(60);
}
 
開發者ID:jMonkeyEngine-Contributions,項目名稱:cubes,代碼行數:8,代碼來源:TestPhysics.java

示例10: EditorMain

import com.jme3.system.AppSettings; //導入方法依賴的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

示例11: TweedFrame

import com.jme3.system.AppSettings; //導入方法依賴的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

示例12: main

import com.jme3.system.AppSettings; //導入方法依賴的package包/類
public static final void main(String[] args) {
	Thread.setDefaultUncaughtExceptionHandler(Main::handleException);
	
	Arguments arguments = new Arguments();
	arguments.addString("game", "../../quadraxample/");
	arguments.addString("mode", "single");
	arguments.addString("path", ".");
	arguments.addString("server-address", "localhost");
	arguments.addInteger("server-tcp-port", 7907);
	arguments.addInteger("server-udp-port", 7908);
	
	arguments.process(args);
	
	Game game = new Game(Paths.get(arguments.getString("game")));
	
	Interlayer interlayer = null;
	
	LoggerFactory.setLogLevel(LogLevel.TRACE);
	
	if (arguments.getString("mode").equals("single")) {
		ServerEnvironment serverEnvironment = new ServerEnvironment(game);
		interlayer = new CloningInterlayer(serverEnvironment);
	} else if (arguments.getString("mode").equals("multi")) {
		interlayer = new KryonetClient(
				arguments.getString("server-address"),
				arguments.getInteger("server-tcp-port"),
				arguments.getInteger("server-udp-port"));
	}
	
	AppSettings appSettings = new AppSettings(true);
	appSettings.setFullscreen(false);
	appSettings.setHeight(600);
	appSettings.setResizable(true);
	appSettings.setTitle("Quadracoatl");
	appSettings.setVSync(false);
	appSettings.setWidth(800);
	
	QuadracoatlApplication application = new QuadracoatlApplication(arguments.getString("path"), interlayer);
	application.setSettings(appSettings);
	application.start(true);
}
 
開發者ID:quadracoatl,項目名稱:quadracoatl,代碼行數:42,代碼來源:Main.java

示例13: TestAustralia

import com.jme3.system.AppSettings; //導入方法依賴的package包/類
public TestAustralia(){
    settings = new AppSettings(true);
    settings.setWidth(1280);
    settings.setHeight(720);
    settings.setTitle("Cubes Demo - Heightmap (Australia)");
}
 
開發者ID:jMonkeyEngine-Contributions,項目名稱:cubes,代碼行數:7,代碼來源:TestAustralia.java

示例14: TestModifications

import com.jme3.system.AppSettings; //導入方法依賴的package包/類
public TestModifications(){
    settings = new AppSettings(true);
    settings.setWidth(1280);
    settings.setHeight(720);
    settings.setTitle("Cubes Demo - Modifications");
}
 
開發者ID:jMonkeyEngine-Contributions,項目名稱:cubes,代碼行數:7,代碼來源:TestModifications.java

示例15: TestPicking

import com.jme3.system.AppSettings; //導入方法依賴的package包/類
public TestPicking(){
    settings = new AppSettings(true);
    settings.setWidth(1280);
    settings.setHeight(720);
    settings.setTitle("Cubes Demo - Picking");
}
 
開發者ID:jMonkeyEngine-Contributions,項目名稱:cubes,代碼行數:7,代碼來源:TestPicking.java


注:本文中的com.jme3.system.AppSettings.setWidth方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。