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


Java PlatformImpl.startup方法代码示例

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


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

示例1: setNowObject

import com.sun.javafx.application.PlatformImpl; //导入方法依赖的package包/类
public static synchronized void setNowObject(Object obj, Field f){
	if (!start)
		start();
	while (!start)
		Animation.sleepSeconds(1);
	PlatformImpl.startup(() -> {});
	Platform.runLater(() -> {
		TreeItem<String> rootItem = new TreeItem<String>((f == null ? "" : f.getName()) + obj.getClass().getName() + " : " + obj);
		TreeView<String> tree = new TreeView<String> (rootItem);
		rootItem.setExpanded(true);
		try {
			addChildren(obj, obj, f, null, rootItem);
		} catch(Exception e){e.printStackTrace();}
		StackPane root = new StackPane();
		root.getChildren().add(tree);
		stage.setScene(new Scene(root));
	});
}
 
开发者ID:NekoCaffeine,项目名称:Alchemy,代码行数:19,代码来源:ActivityTreeViewSample.java

示例2: createScene

import com.sun.javafx.application.PlatformImpl; //导入方法依赖的package包/类
private void createScene() {
	PlatformImpl.startup(new Runnable() {
		@Override
		public void run() {
			stage = new Stage();
			Group root = new Group();
			Scene scene = new Scene(root, 900, 680);
			stage.setScene(scene);
			// Set up the embedded browser:
			browser = new WebView();
			browser.setMinSize(900, 680);
			webEngine = browser.getEngine();
			webEngine.load(getClass().getResource("/index.html").toString());
			ObservableList<Node> children = root.getChildren();
			children.add(browser);
			jfxPanel.setScene(scene);
		}
	});
}
 
开发者ID:thibaultcha,项目名称:TweetStats,代码行数:20,代码来源:MapView.java

示例3: initFx

import com.sun.javafx.application.PlatformImpl; //导入方法依赖的package包/类
private static void initFx() {
    AccessController.doPrivileged((PrivilegedAction<Void>) () -> {
        System.setProperty("javafx.embed.isEventThread", "true");
        System.setProperty("glass.win.uiScale", "100%");
        System.setProperty("glass.win.renderScale", "100%");
        return null;
    });
    Map map = Application.getDeviceDetails();
    if (map == null) {
        Application.setDeviceDetails(map = new HashMap());
    }
    if (map.get("javafx.embed.eventProc") == null) {
        long eventProc = 0;
        try {
            Field field = Display.class.getDeclaredField("eventProc");
            field.setAccessible(true);
            if (field.getType() == int.class) {
                eventProc = field.getLong(Display.getDefault());
            } else {
                if (field.getType() == long.class) {
                    eventProc = field.getLong(Display.getDefault());
                }
            }
        } catch (Throwable th) {
            //Fail silently
        }
        map.put("javafx.embed.eventProc", eventProc);
    }
    // Note that calling PlatformImpl.startup more than once is OK
    PlatformImpl.startup(() -> {
        Application.GetApplication().setName(Display.getAppName());
    });
}
 
开发者ID:TRUEJASONFANS,项目名称:JavaFX-FrameRateMeter,代码行数:34,代码来源:OldFXCanvas.java

示例4: createScene

import com.sun.javafx.application.PlatformImpl; //导入方法依赖的package包/类
/**
    * createScene
    *
    * Note: Key is that Scene needs to be created and run on "FX user thread"
    *       NOT on the AWT-EventQueue Thread
    *
    */
   @SuppressWarnings("restriction")
private void createScene() {
       PlatformImpl.startup(new Runnable() {
           @Override
           public void run() {

               stage = new Stage();

               stage.setTitle("Hello Java FX");
               stage.setResizable(true);

               Group root = new Group();
               Scene scene = new Scene(root,80,20);
               stage.setScene(scene);

               // Set up the embedded browser:
               browser = new WebView();
               webEngine = browser.getEngine();
               webEngine.load("https://sourceforge.net/p/mars-sim/discussion/");//"http://www.google.com");

               ObservableList<Node> children = root.getChildren();
               children.add(browser);

               jfxPanel.setScene(scene);
           }
       });
   }
 
开发者ID:mars-sim,项目名称:mars-sim,代码行数:35,代码来源:SwingFXWebView.java

示例5: createScene

import com.sun.javafx.application.PlatformImpl; //导入方法依赖的package包/类
private void createScene() {
        PlatformImpl.startup(() -> {
            Stage stage;
            WebView browser;
            stage = new Stage();

            stage.setTitle("Hello Java FX");
            stage.setResizable(true);

            Group root = new Group();
            Scene scene = new Scene(root, 80, 20);
            stage.setScene(scene);

            // Set up the embedded browser:
            browser = new WebView();
            webEngine = browser.getEngine();
//                webEngine.load("http://heise.de");


//                ScrollPane scrollPane = new ScrollPane();
//                scrollPane.setContent(browser);
            webEngine.loadContent("<b>asdf</b>");

//                root.getChildren().addAll(scrollPane);
//                scene.setRoot(root);
//                stage.setScene(scene);


            root.getChildren().add(browser);
//                children.add(browser);

            jfxPanel.setScene(scene);
        });

        while (webEngine == null) {
            Utils.sleep(25);
        }
    }
 
开发者ID:holgerbrandl,项目名称:opencards,代码行数:39,代码来源:MdSlideManager.java

示例6: createScene

import com.sun.javafx.application.PlatformImpl; //导入方法依赖的package包/类
/**
     * createScene
     * <p/>
     * Note: Key is that Scene needs to be created and run on "FX user thread" NOT on the AWT-EventQueue Thread
     */
    private void createScene() {
        PlatformImpl.startup(new Runnable() {
            @Override
            public void run() {
                Stage stage;
                WebView browser;
                stage = new Stage();

                stage.setTitle("Hello Java FX");
                stage.setResizable(true);

                Group root = new Group();
                Scene scene = new Scene(root, 80, 20);
                stage.setScene(scene);

                // Set up the embedded browser:
                browser = new WebView();
                webEngine = browser.getEngine();
//                webEngine.load("http://heise.de");


//                ScrollPane scrollPane = new ScrollPane();
//                scrollPane.setContent(browser);
                webEngine.loadContent("<b>asdf</b>");

//                root.getChildren().addAll(scrollPane);
//                scene.setRoot(root);
//                stage.setScene(scene);


                ObservableList<Node> children = root.getChildren();
                children.add(browser);

                jfxPanel.setScene(scene);
            }
        });
    }
 
开发者ID:holgerbrandl,项目名称:opencards,代码行数:43,代码来源:SwingFXWebView.java

示例7: initJfx

import com.sun.javafx.application.PlatformImpl; //导入方法依赖的package包/类
public static void initJfx() {
	//new JFXPanel();
	// Note that calling PlatformImpl.startup more than once is OK
	//if (!initialized.get()) {
		PlatformImpl.startup(() -> {
			Helper.initJfxStyle();
		});
	//}
}
 
开发者ID:davidB,项目名称:jme3_ext_spatial_explorer,代码行数:10,代码来源:Helper.java

示例8: initJavaFX

import com.sun.javafx.application.PlatformImpl; //导入方法依赖的package包/类
@Before
public void initJavaFX() throws Exception {
	// Initialize Platform (required by FX components).
	PlatformImpl.startup(() -> {
		// Nothing
	});
	
	// Initialize injector and fxml loader.
	TestApplication app = new TestApplication();
	app.init();
	fxmlLoader = app.getInjector().getInstance(GuiceFXMLLoader.class);
}
 
开发者ID:chilloutman,项目名称:photo-flow,代码行数:13,代码来源:ControllerTest.java

示例9: call3

import com.sun.javafx.application.PlatformImpl; //导入方法依赖的package包/类
public Sequence call3(XPathContext context, Sequence[] arguments) throws XPathException {
			
        	logger.info("call");
        	try {
            FXThread fxThread = new FXThread();
            Platform.setImplicitExit(false);
            PlatformImpl.startup(fxThread);
            fxThread.join();
//            Platform.runLater(fxThread);
        	} catch (Exception e) {
        		logger.error(e, e);
        	}
	        return EmptySequence.getInstance();
        	
//        	String inputString = "";		
//        	SequenceIterator selectIterator	= arguments[HTML].iterate();
//            Item item = selectIterator.next();
//            while (item != null) {
//            	if (item instanceof StringValue) {		
//            		inputString += item.getStringValue();
//				} else if (item instanceof NodeInfo) {
//					inputString += QueryResult.serialize((NodeInfo)item);
//				} else {
//					throw new XPathException("Can't serialize item: " + item.getClass()); 
//				}
//            	item = selectIterator.next();
//            }
//        	
//        	final SequenceOutputter out = context.getController().allocateSequenceOutputter(50);
//        	
//        	out.startElement(new NoNamespaceName("Input"), Untyped.getInstance(), locationId, 0);
//        	out.characters(inputString, locationId, 0);
//        	out.endElement();
//        	
//        	out.startElement(new NoNamespaceName("Result"), Untyped.getInstance(), locationId, 0);
//        	out.characters("Hello, world!", locationId, 0);
//        	out.endElement();
//        	
//        	return SequenceTool.toLazySequence(out.iterate());
        }
 
开发者ID:dita-semia,项目名称:XsltGui,代码行数:41,代码来源:GuiTest.java

示例10: initFx

import com.sun.javafx.application.PlatformImpl; //导入方法依赖的package包/类
private static void initFx() {
    AccessController.doPrivileged((PrivilegedAction<Void>) () -> {
        System.setProperty("javafx.embed.isEventThread", "true");
        return null;
    });
    Map map = Application.getDeviceDetails();
    if (map == null) {
        Application.setDeviceDetails(map = new HashMap());
    }
    if (map.get("javafx.embed.eventProc") == null) {
        long eventProc = 0;
        try {
            Field field = Display.class.getDeclaredField("eventProc");
            field.setAccessible(true);
            if (field.getType() == int.class) {
                eventProc = field.getLong(Display.getDefault());
            } else {
                if (field.getType() == long.class) {
                    eventProc = field.getLong(Display.getDefault());
                }
            }
        } catch (Throwable th) {
            //Fail silently
        }
        map.put("javafx.embed.eventProc", eventProc);
    }
    // Note that calling PlatformImpl.startup more than once is OK
    PlatformImpl.startup(() -> {
        Application.GetApplication().setName(Display.getAppName());
    });
}
 
开发者ID:SkyLandTW,项目名称:JXTN,代码行数:32,代码来源:FXCanvas.java

示例11: createScene

import com.sun.javafx.application.PlatformImpl; //导入方法依赖的package包/类
/** 
 * createScene 
 * 
 * Note: Key is that Scene needs to be created and run on "FX user thread" 
 *       NOT on the AWT-EventQueue Thread 
 * 
 */  
private void createScene(JFXPanel jfxPanel) {
    PlatformImpl.startup(new Runnable() {  
        @Override
        public void run() {
            Stage stage = new Stage();
            StackPane root =  new StackPane();
            Scene scene = new Scene(root);
            stage.setScene(scene);
            Platform.setImplicitExit(false);
             
            // Set up the embedded browser:
            browser = new WebView();
            final WebEngine webEngine = browser.getEngine();
            webEngine.setJavaScriptEnabled(true);
            webEngine.load("http://warfront1.github.io/AutoFletcherElite/UserInterfaces/AutoFletcherElitePaint.html");
            webEngine.getLoadWorker().stateProperty().addListener(
                    new ChangeListener<Worker.State>() {
                        Bridge javaBridge = new Bridge(webEngine);
                        @Override
                        public void changed(ObservableValue ov, Worker.State oldState, Worker.State newState) {
                            if (newState == Worker.State.SUCCEEDED) {
                                JSObject jso = (JSObject) webEngine.executeScript("window");
                                jso.setMember("java", javaBridge);
                            }

                        }
                    });
            ObservableList<Node> children = root.getChildren();
            children.add(browser);                     
            
            jfxPanel.setScene(scene);
        }

    });  
}
 
开发者ID:Warfront1,项目名称:AutoFletcherElite,代码行数:43,代码来源:Paint.java

示例12: createScene

import com.sun.javafx.application.PlatformImpl; //导入方法依赖的package包/类
/** 
     * createScene 
     * 
     * Note: Key is that Scene needs to be created and run on "FX user thread" 
     *       NOT on the AWT-EventQueue Thread 
     * 
     */  
    private void createScene() {  
        PlatformImpl.startup(new Runnable() {  
            @Override
            public void run() {  
                 
                stage = new Stage();  
                 
                stage.setTitle("Hello Java FX");  
                StackPane root =  new StackPane();
                Scene scene = new Scene(root, 470,680);  
                stage.setScene(scene);  
                Platform.setImplicitExit(false);
                 
                // Set up the embedded browser:
                browser = new WebView();
                final WebEngine webEngine = browser.getEngine();
                webEngine.setJavaScriptEnabled(true);
//                webEngine.load("http://elitescripts.tk/AutoFletcherElite/AutoFletcherEliteGUI.html");
                webEngine.load("http://warfront1.github.io/AutoFletcherElite/UserInterfaces/AutoFletcherEliteGUI.html");
                webEngine.getLoadWorker().stateProperty().addListener(
                        new ChangeListener<Worker.State>() {
                            Bridge javaBridge = new Bridge(webEngine);
                            @Override
                            public void changed(ObservableValue ov, Worker.State oldState, Worker.State newState) {
                                if (newState == Worker.State.SUCCEEDED) {                        
                                    JSObject jso = (JSObject) webEngine.executeScript("window");
                                    jso.setMember("java", javaBridge);
                                }

                            }
                        });
                ObservableList<Node> children = root.getChildren();
                children.add(browser);                     
                
                jfxPanel.setScene(scene);  
                System.out.println("Main FX UI Successfully Created!");
            }  
        });  
    }
 
开发者ID:Warfront1,项目名称:AutoFletcherElite,代码行数:47,代码来源:JavaFXUI.java

示例13: testSimpleLogin

import com.sun.javafx.application.PlatformImpl; //导入方法依赖的package包/类
public void testSimpleLogin() throws InterruptedException {

        CountDownLatch waitForIt = new CountDownLatch(1);

        PlatformImpl.startup(() -> {
            WebView loginView = new WebView();
            loginView.setPrefWidth(600);
            loginView.setPrefHeight(600);

            CoinBaseOAuth cbl = new CoinBaseOAuth(loginView);
            cbl.checkTokens(true, true);

            Scene theScene = new Scene(loginView);
            Stage theStage = new Stage();
            theStage.setScene(theScene);
            theStage.setOnHiding(e -> waitForIt.countDown());


            cbl.accessTokenProperty().addListener((change, oldV, newV) -> {
                System.out.println(newV);
                CoinBaseAPI cbapi = new CoinBaseAPI(cbl);
                List<CBAddress> addresses = cbapi.getAddresses();
                System.out.println(addresses);
                addresses.forEach(a -> System.out.println(a.getJsonSeed()));
                waitForIt.countDown();
            });
            if (!cbl.checkTokens(true, true)) {
                theStage.show();
            }
        });

        waitForIt.await();
    }
 
开发者ID:shemnon,项目名称:FollowTheBitcoin,代码行数:34,代码来源:OAuthLoginTest.java

示例14: FXEditorTaskExecutor

import com.sun.javafx.application.PlatformImpl; //导入方法依赖的package包/类
/**
 * Instantiates a new Fx editor task executor.
 */
public FXEditorTaskExecutor() {
    setName(FXEditorTaskExecutor.class.getSimpleName());
    setPriority(NORM_PRIORITY);
    PlatformImpl.startup(this::start);
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:9,代码来源:FXEditorTaskExecutor.java

示例15: initialisePlatform

import com.sun.javafx.application.PlatformImpl; //导入方法依赖的package包/类
@BeforeClass public static void initialisePlatform(){
   PlatformImpl.startup( () -> {} );
}
 
开发者ID:DanGrew,项目名称:JttDesktop,代码行数:4,代码来源:DualBuildWallContextMenuOpenerTest.java


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