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


Java AppSettings類代碼示例

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


AppSettings類屬於com.jme3.system包,在下文中一共展示了AppSettings類的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: prepareToStart

import com.jme3.system.AppSettings; //導入依賴的package包/類
/**
 * Prepare to start editor.
 *
 * @return the editor
 */
@JMEThread
static @NotNull Editor prepareToStart() {

    if (Config.DEV_DEBUG) {
        System.err.println("config is loaded.");
    }

    configureLogger();
    try {

        final EditorConfig config = EditorConfig.getInstance();
        final AppSettings settings = config.getSettings();

        EDITOR.setSettings(settings);
        EDITOR.setShowSettings(false);
        EDITOR.setDisplayStatView(false);
        EDITOR.setDisplayFps(false);

    } catch (final Exception e) {
        LOGGER.warning(e);
        throw new RuntimeException(e);
    }

    return EDITOR;
}
 
開發者ID:JavaSaBr,項目名稱:jmonkeybuilder,代碼行數:31,代碼來源:Editor.java

示例3: getSettings

import com.jme3.system.AppSettings; //導入依賴的package包/類
/**
 * Gets settings.
 *
 * @return the settings for JME.
 */
@FromAnyThread
public AppSettings getSettings() {

    final GraphicsEnvironment graphicsEnvironment = GraphicsEnvironment.getLocalGraphicsEnvironment();
    final GraphicsDevice device = graphicsEnvironment.getDefaultScreenDevice();
    final DisplayMode displayMode = device.getDisplayMode();

    final AppSettings settings = new AppSettings(true);
    settings.setFrequency(displayMode.getRefreshRate());
    settings.setGammaCorrection(isGammaCorrection());
    settings.setResizable(true);
    // settings.putBoolean("GraphicsDebug", true);

    JmeToJFXIntegrator.prepareSettings(settings, getFrameRate());

    return settings;
}
 
開發者ID:JavaSaBr,項目名稱:jmonkeybuilder,代碼行數:23,代碼來源:EditorConfig.java

示例4: main

import com.jme3.system.AppSettings; //導入依賴的package包/類
public static void main(String[] args) {
    TestChangeAppIcon app = new TestChangeAppIcon();
    AppSettings settings = new AppSettings(true);

    try {
        Class<TestChangeAppIcon> clazz = TestChangeAppIcon.class;

        settings.setIcons(new BufferedImage[]{
                    ImageIO.read(clazz.getResourceAsStream("/Interface/icons/SmartMonkey256.png")),
                    ImageIO.read(clazz.getResourceAsStream("/Interface/icons/SmartMonkey128.png")),
                    ImageIO.read(clazz.getResourceAsStream("/Interface/icons/SmartMonkey32.png")),
                    ImageIO.read(clazz.getResourceAsStream("/Interface/icons/SmartMonkey16.png")),
                });
    } catch (IOException e) {
        log.log(java.util.logging.Level.WARNING, "Unable to load program icons", e);
    }
    app.setSettings(settings);
    app.start();
}
 
開發者ID:mleoking,項目名稱:PhET,代碼行數:20,代碼來源:TestChangeAppIcon.java

示例5: main

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

    final Application app = new Application();
    app.setSettings(settings);
    app.start();

    Thread.sleep(3000);

    settings.setFullscreen(true);
    settings.setResolution(-1, -1);
    app.setSettings(settings);
    app.restart();

    Thread.sleep(3000);

    app.stop();
}
 
開發者ID:mleoking,項目名稱:PhET,代碼行數:19,代碼來源:TestContextRestart.java

示例6: start

import com.jme3.system.AppSettings; //導入依賴的package包/類
@Override
public void start() {
    // set some default settings in-case
    // settings dialog is not shown
    boolean loadSettings = false;
    if (settings == null) {
        setSettings(new AppSettings(true));
        loadSettings = true;
    }

    // show settings dialog
    if (showSettings) {
        if (!JmeSystem.showSettingsDialog(settings, loadSettings)) {
            return;
        }
    }
    //re-setting settings they can have been merged from the registry.
    setSettings(settings);
    super.start();
}
 
開發者ID:mleoking,項目名稱:PhET,代碼行數:21,代碼來源:SimpleApplication.java

示例7: setSettings

import com.jme3.system.AppSettings; //導入依賴的package包/類
/**
 * Set the display settings to define the display created. Examples of
 * display parameters include display pixel width and height,
 * color bit depth, z-buffer bits, anti-aliasing samples, and update frequency.
 *
 * @param settings The settings to set.
 */
public void setSettings(AppSettings settings){
    this.settings = settings;
    if (context != null && settings.useInput() != inputEnabled){
        // may need to create or destroy input based
        // on settings change
        inputEnabled = !inputEnabled;
        if (inputEnabled){
            initInput();
        }else{
            destroyInput();
        }
    }else{
        inputEnabled = settings.useInput();
    }
}
 
開發者ID:mleoking,項目名稱:PhET,代碼行數:23,代碼來源:Application.java

示例8: init

import com.jme3.system.AppSettings; //導入依賴的package包/類
public void init(SurveyPlayback sim) {

		mSettings = new AppSettings(true);

		mSettings.setTitle("HELIOS - The Heidelberg LiDAR Operations Simulator");
		mSettings.setVSync(true);
		mSettings.setResolution(1680, 1050);
		mSettings.setResolution(1280, 1024);
		mSettings.setResolution(1600, 1024);
		// setting.setResolution(1024,768);
		mSettings.setResolution(1024,768);

		mSettings.setSamples(4);

		setSettings(mSettings);

		setShowSettings(false);

		// ATTENTION: This is REQUIRED to prevent freezing of the whole computer if the program loses focus!
		// setPauseOnLostFocus() must be "false" since currently, setting it to "true" won't stop the actual simulation anyway.
		setPauseOnLostFocus(false);
		this.sim = sim;
	}
 
開發者ID:GIScience,項目名稱:helios,代碼行數:24,代碼來源:JMEFrontEnd.java

示例9: setSettings

import com.jme3.system.AppSettings; //導入依賴的package包/類
@Override
public void setSettings(AppSettings settings) {
    this.settings = settings;
    
    // 實際的渲染引擎,如果進行了特別指定,否則使用LWJGL_OPENGL2作為實際的內部包裝用擎
    String jfxRenderer = (String) this.settings.get(JFX_WRAP_RENDERER);
    if (jfxRenderer != null) {
        this.settings.setRenderer(jfxRenderer);
    } else {
        this.settings.setRenderer(AppSettings.LWJGL_OPENGL2);
    }
    
    if (innerContext != null){
        innerContext.setSettings(this.settings);
    }
}
 
開發者ID:huliqing,項目名稱:LuoYing,代碼行數:17,代碼來源:JfxContext.java

示例10: 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

示例11: 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

示例12: startSimulation

import com.jme3.system.AppSettings; //導入依賴的package包/類
public void startSimulation(boolean debugShapes) throws InterruptedException {

        AppSettings simWindowSettings = new AppSettings(true);
        simWindowSettings.setTitle("Simulation Environment for Autonomous Robots");
        searSim.setSettings(simWindowSettings);

        searSim.setShowSettings(false);  //Prevents the Jmonkey dialog window from popping up. Must be set before app.start()
        searSim.setPauseOnLostFocus(false); //keeps simulation going while window is not in focus or selected. Allows it to run in the background.

        if (debugShapes) {
            searSim.setDebugMode();
        }

        searSim.startSimulation(this.getName());

        while (!searSim.initialized()) {
            Thread.sleep(333); //wait 1/3 of a second and check  
        }
        invoke("getHashMap");
    }
 
開發者ID:glaudiston,項目名稱:project-bianca,代碼行數:21,代碼來源:SEAR.java

示例13: getDisplayModes

import com.jme3.system.AppSettings; //導入依賴的package包/類
/**
 * Gets the display modes.
 *
 * @return the display modes
 */
private DisplayMode[] getDisplayModes()
{
	DisplayMode[] modes = null;
	try
	{
		AppSettings settings = new AppSettings(true);
		JmeSystem.initialize(settings);
		modes = Display.getAvailableDisplayModes();
		Arrays.sort(modes, new DisplayModeComparator());
		Display.destroy();
	}
	catch (LWJGLException e)
	{
		e.printStackTrace();
	}
	return modes;
}
 
開發者ID:synergynet,項目名稱:synergynet3.1,代碼行數:23,代碼來源:DisplayConfigPanel.java

示例14: 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

示例15: load

import com.jme3.system.AppSettings; //導入依賴的package包/類
public static AppSettings load() {
    if (!loc.exists()) {
        return null;
    }
    try {
        InputStream in = new FileInputStream(loc);
        AppSettings sets = new AppSettings(true);
        sets.load(in);
        sets.setIcons(getIcons());
        in.close();
        logger.info("loaded settings");
        return sets;
    } catch (IOException ex) {
        logger.log(Level.SEVERE, null, ex);
        return null;
    }
}
 
開發者ID:matthewseal,項目名稱:MoleculeViewer,代碼行數:18,代碼來源:Settings.java


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