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


Java AppSettings.load方法代碼示例

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


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

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

示例2: main

import com.jme3.system.AppSettings; //導入方法依賴的package包/類
public static void main(String[] args) throws BackingStoreException {
    	Locale.setDefault(Locale.ENGLISH);
        MainApp app = new MainApp();
        app.setPauseOnLostFocus(false);
        app.setDisplayStatView(false);
        app.setDisplayFps(false);

                
        AppSettings settings = new AppSettings(false);
        settings.load("SMILE");
        settings.setTitle("SMILE");
        settings.setSettingsDialogImage("Interface/line500px.png");
        settings.setFrameRate(60);
        settings.setSamples(2);
        settings.putBoolean("DisableJoysticks", false);
        settings.save("SMILE");

        //        settings.setVSync(true);
//        settings.setResolution(800, 600);
//        settings.setSamples(4);
//        settings.setFullscreen(true);
//        GraphicsDevice device = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
//        DisplayMode[] modes = device.getDisplayModes();
//        for (int i = 0; i < modes.length; ++i) {
//            System.err.println(modes[i].getWidth() + "x" + modes[i].getHeight() + " " + modes[i].getRefreshRate()
//                    + " " + modes[i].getBitDepth());
//        }
//
//        int i = 10; // note: there are usually several, let's pick the first
//        settings.setResolution(modes[i].getWidth(), modes[i].getHeight());
//        settings.setFrequency(modes[i].getRefreshRate());
//        settings.setBitsPerPixel(modes[i].getBitDepth());
////        settings.setFullscreen(device.isFullScreenSupported());
        
        app.setSettings(settings);
        app.setShowSettings(true);
        
        app.start(); // restart the context to apply changes
    }
 
開發者ID:dwhuang,項目名稱:SMILE,代碼行數:40,代碼來源:MainApp.java


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