本文整理汇总了Java中javafx.application.Application类的典型用法代码示例。如果您正苦于以下问题:Java Application类的具体用法?Java Application怎么用?Java Application使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Application类属于javafx.application包,在下文中一共展示了Application类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: bootstrap
import javafx.application.Application; //导入依赖的package包/类
public static synchronized void bootstrap() {
if( launched ) {
return;
}
launched = true;
l = new CountDownLatch(1);
Thread t = new Thread() {
@Override
public void run() {
Application.launch(BootApplication.class);
}
};
t.start();
try {
l.await();
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
示例2: plot
import javafx.application.Application; //导入依赖的package包/类
public static void plot(LineGraph... graphs) {
if (plotted)
throw new RuntimeException("Plot can be called only once. Instead put all graphs in one call.");
plotted = true;
Plotter.graphs = graphs;
try {
Application.launch();
} catch (IllegalStateException e) {
showGraphs();
}
}
示例3: setTheme
import javafx.application.Application; //导入依赖的package包/类
public void setTheme() {
JSONObject themeSection = Preferences.instance().getSection("theme");
boolean builtin = themeSection.optBoolean("builtin");
String path = themeSection.optString("path", "/themes/marathon.css");
String name = themeSection.optString("name", "Marathon");
if (builtin) {
if (name != null) {
Application.setUserAgentStylesheet(name);
}
} else {
if (path != null) {
URL resource = getClass().getResource(path);
if (resource != null) {
Application.setUserAgentStylesheet(resource.toExternalForm());
}
}
}
}
示例4: main
import javafx.application.Application; //导入依赖的package包/类
public static void main(String[] args) {
if(args.length >= 1){
try{
StarsRiver.MainWindows.date = LocalDate.parse(args[0],DateTimeFormatter.ofPattern("yyyy-MM-dd"));
}
catch(Exception e){
StarsRiver.MainWindows.date = LocalDate.now();
}
}
Application.launch(MainWindows.class, args);
}
示例5: startGUI
import javafx.application.Application; //导入依赖的package包/类
protected static void startGUI() {
new Thread() {
public void run() {
Application.launch(GOGUIImpl.class);
}
}.start();
}
示例6: main
import javafx.application.Application; //导入依赖的package包/类
public static void main(String[] args) throws IOException {
try {
Application.launch(args);
System.exit(0);
} catch (Exception e) {
LOGGER.error("Uncaught exception", e);
System.exit(1);
}
}
示例7: startApplication
import javafx.application.Application; //导入依赖的package包/类
public static void startApplication() {
new Thread(new Runnable() {
@Override public void run() {
Application.launch(ApplicationHelper.class);
}
}).start();
}
示例8: start
import javafx.application.Application; //导入依赖的package包/类
@Override
public void start(Stage primaryStage) throws Exception {
try {
final SplashScreen splash = SplashScreen.getSplashScreen();
// Determine if we passed anything on the cmd line
parseCmdLine();
// Define our controllers
SpeedGuideViewController viewController = loadFXMLController("view/SpeedGuideView.fxml");
SpeedGuideConnection connectionController = loadFXMLController("view/ConnectionDialog.fxml");
// Wire up our Model/View/Controllers
viewController.setConnectionViewController(connectionController);
viewController.setDebug(m_debug);
viewController.defineControlBindings(m_consumer);
// Notify our consumer some setup information
m_consumer.setDebug(m_debug);
m_consumer.setViewController(viewController);
// Define the main viewing scene,
AnchorPane layout = viewController.getLayout();
Scene scene = new Scene(layout, layout.getPrefWidth(), layout.getPrefHeight());
// Prevent the user from resizing the window too small
primaryStage.setMinHeight(layout.getMinHeight());
primaryStage.setMinWidth(layout.getMinWidth());
// Assign to our main stage and show the application to the end user
primaryStage.setTitle("Speed Guide");
primaryStage.setScene(scene);
primaryStage.show();
// Set up our EMA Consumer and launch a thread to run...
Thread t = new Thread(m_consumer);
t.start();
Application.Parameters params = getParameters();
connectionController.initialize(params.getNamed().get(HOST_PARAM),
params.getNamed().get(SERVICE_PARAM),
params.getNamed().get(USER_PARAM),
m_consumer);
// Attempt to Connect into Elektron
if ( splash != null )
splash.close();
connectionController.connect();
} catch (Exception e) {
System.out.print("Exception in Application Start: ");
e.printStackTrace();
stop();
}
}
示例9: initJFX
import javafx.application.Application; //导入依赖的package包/类
@BeforeClass
public static void initJFX() {
Thread t = new Thread("JavaFX Init Thread") {
public void run() {
Application.launch(FakeApp.class, new String[0]);
}
};
t.setDaemon(true);
t.start();
}
示例10: main
import javafx.application.Application; //导入依赖的package包/类
/**
* @param args
* the Arguments used to start the JVM
* @throws InterruptedException
* When something unexcpted happens
*/
public static void main(String[ ] args) throws InterruptedException
{
Main.launchArgs = args.clone();
PWLogger.setupLogger();
PWLogger.getLogger("Main").info("Starting");
PWLogger.getLogger("Main").info("Startup Arguments: " + Arrays.toString(Main.launchArgs));
Application.launch(Overview.class, args);
PWLogger.getLogger("Main").info("Exit");
}
示例11: main
import javafx.application.Application; //导入依赖的package包/类
public static void main (String[] args) {
//initialize language files
LangInitializer.init("./data/i18n/languages.json");
//create JavaFX window
Application.launch(JavaFXApplication.class, args);
}
示例12: shouldRunBravo
import javafx.application.Application; //导入依赖的package包/类
@Test
public void shouldRunBravo() throws InterruptedException {
Application.launch(BravoTestApp.class, null);
finishedAnimation.await();
assertTrue(duration > 13000);
assertTrue(duration < 14000);
}
示例13: parseCmdLine
import javafx.application.Application; //导入依赖的package包/类
private void parseCmdLine() throws Exception
{
Application.Parameters params = getParameters();
if ( params.getRaw().contains("--h") || params.getRaw().contains("--help") ||
params.getNamed().containsKey("h") || params.getNamed().containsKey("help"))
{
System.out.println(NEWLINE+"Syntax:"+NEWLINE);
System.out.println(" > java -jar SpeedGuide.jar [options] or"+NEWLINE);
System.out.println(" > SpeedGuide.exe [options] <Windows only>"+NEWLINE);
System.out.println("Options:"+NEWLINE);
System.out.println(" --host=hostname:port Server address/hostname and port of your Market Data server.");
System.out.println(" Syntax: <host/ip>:<port>. Eg: elektron:14002 or 192.168.1.1:14002");
System.out.println(" --service=serviceName Service Name providing market data content.");
System.out.println(" Eg: ELEKTRON_AD.");
System.out.println(" --user=userName User name required if authentication is enabled on server.");
System.out.println(" Note: if no user name is provided, the utility will use your desktop login");
System.out.println(" --d[ebug] Debug Mode. Display verbose messages to the console");
System.out.println(" --h[elp] Prints this screen"+NEWLINE);
System.out.println("If neither the --host nor --service is not provided, the utility will prompt the user to enter these values."+NEWLINE);
System.out.println("Example:");
System.out.println(" > SpeedGuide.exe --host=elektron:14002 --service=ELEKTRON_AD -user=testuser");
stop();
}
m_debug = params.getRaw().contains("--d") || params.getRaw().contains("--debug") ||
params.getNamed().containsKey("d") || params.getNamed().containsKey("debug");
}
示例14: main
import javafx.application.Application; //导入依赖的package包/类
public static void main(String[] args) throws ReflectiveOperationException {
loadPlugins();
// IntelliJ is not able to comprehend this much Lambda? (as it was before)
Registerer.registerObjects(Device.class, DeviceRegister.getInstance());
Registerer.registerParsed(Effect.class, c -> EffectFactory.createFactory(c), EffectsRegister.getInstance());
Registerer.registerParsed(ValueStrategy.class, c -> ValueStrategyFactory.createFactory(c), ValueStrategyRegister.getInstance());
Registerer.registerParsed(BlendMode.class, c -> BlendModeFactory.createFactory(c), BlendModeRegister.getInstance());
Registerer.registerParsed(ScaleMode.class, c -> ScaleModeFactory.createFactory(c), ScaleModeRegister.getInstance());
Application.launch(KeyboardLightComposerApplication.class, args);
// DefaultRenderer renderer = new DefaultRenderer();
// Device device =
// DeviceRegister.getInstance().getRegisteredObjectsAsList().get(0);
//
// renderer.setDevice(device);
//
// Effect effect =
// EffectsRegister.getInstance().getRegisteredObjectsAsList().get(0).newInstance();
// EffectLayer solidColorLayer = new EffectLayer(effect);
//
// solidColorLayer.getEffectLayerInformation().getWidth().setValue(5);
// solidColorLayer.getEffectLayerInformation().getHeight().setValue(3);
//
// solidColorLayer.getEffectLayerInformation().getX().setValue(3);
// solidColorLayer.getEffectLayerInformation().getY().setValue(3);
//
// device.init();
//
// renderer.render(Arrays.asList(solidColorLayer));
//
// sleep();
//
// device.shutdown();
}
示例15: buildDockPane
import javafx.application.Application; //导入依赖的package包/类
private void buildDockPane() {
dockPane = new DockPane();
Application.setUserAgentStylesheet(Application.STYLESHEET_MODENA);
DockPane.initializeDefaultUserAgentStylesheet();
}