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


Java AnchorPane.getPrefWidth方法代码示例

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


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

示例1: start

import javafx.scene.layout.AnchorPane; //导入方法依赖的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();
	}
}
 
开发者ID:TR-API-Samples,项目名称:Example.EMA.Java.SpeedGuide,代码行数:55,代码来源:SpeedGuide.java

示例2: CustomStage

import javafx.scene.layout.AnchorPane; //导入方法依赖的package包/类
public CustomStage(AnchorPane ap, StageStyle style) {
    initStyle(style);

    setSize(ap.getPrefWidth(), ap.getPrefHeight());

    Rectangle2D screenBounds = Screen.getPrimary().getVisualBounds();
    double x = screenBounds.getMinX() + screenBounds.getWidth() - ap.getPrefWidth() - 2;
    double y = screenBounds.getMinY() + screenBounds.getHeight() - ap.getPrefHeight() - 2;

    bottomRight = Location.at(x, y);
}
 
开发者ID:victorward,项目名称:recruitervision,代码行数:12,代码来源:CustomStage.java


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