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


Java JavaFXBuilderFactory类代码示例

本文整理汇总了Java中javafx.fxml.JavaFXBuilderFactory的典型用法代码示例。如果您正苦于以下问题:Java JavaFXBuilderFactory类的具体用法?Java JavaFXBuilderFactory怎么用?Java JavaFXBuilderFactory使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: start

import javafx.fxml.JavaFXBuilderFactory; //导入依赖的package包/类
@Override
public void start(Stage primaryStage) throws Exception {
    final Injector injector = Guice.createInjector(new WizardModule());

    final URL fxml = WizardMain.class.getClassLoader().getResource("wizard-fxml/Wizard.fxml");

    if (fxml != null) {
        final Parent p = FXMLLoader.load(fxml,
                null,
                new JavaFXBuilderFactory(),
                injector::getInstance
        );

        final Scene scene = new Scene(p);

        primaryStage.setScene(scene);
        primaryStage.setWidth(800);
        primaryStage.setHeight(600);
        primaryStage.setTitle("Java gEneric DAta Integration (JedAI) Toolkit");

        primaryStage.show();
    }
}
 
开发者ID:scify,项目名称:jedai-ui,代码行数:24,代码来源:WizardMain.java

示例2: getPane

import javafx.fxml.JavaFXBuilderFactory; //导入依赖的package包/类
public static <T extends ContentPane> T getPane(Class<T> clazz) {
	try {
		ContentPane pane = clazz.newInstance();
		URL fxmlUrl = pane.getFXMLUrl();
		FXMLLoader fxmlLoader = new FXMLLoader(fxmlUrl);
		fxmlLoader.setBuilderFactory(new JavaFXBuilderFactory());
		pane.setFXMLLoader(fxmlLoader);
		fxmlLoader.setController(pane);
		pane.setNode();
		if (pane.showInSideBar()) {
			panesList.add(pane);
		}
		return fxmlLoader.getController();
	} catch (Exception e) {
		OneClientLogging.error(e);
	}
	return null;
}
 
开发者ID:HearthProject,项目名称:OneClient,代码行数:19,代码来源:ContentPanes.java

示例3: openLoginGui

import javafx.fxml.JavaFXBuilderFactory; //导入依赖的package包/类
public static void openLoginGui() {
	try {
		ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
		URL fxmlUrl = classLoader.getResource("gui/mc_auth.fxml");
		if (fxmlUrl == null) {
			OneClientLogging.logger.error("An error has occurred loading mc_auth.fxml!");
			return;
		}
		FXMLLoader fxmlLoader = new FXMLLoader();
		fxmlLoader.setLocation(fxmlUrl);
		fxmlLoader.setBuilderFactory(new JavaFXBuilderFactory());
		Parent root = fxmlLoader.load(fxmlUrl.openStream());
		Stage stage = new Stage();
		stage.setTitle("One Client - Login to minecraft");
		stage.getIcons().add(new Image("images/icon.png"));
		stage.setResizable(false);
		stage.initOwner(Main.stage);
		stage.initModality(Modality.WINDOW_MODAL);
		Scene scene = new Scene(root, 600, 300);
		scene.getStylesheets().add("gui/css/theme.css");
		stage.setScene(scene);
		stage.initModality(Modality.WINDOW_MODAL);
		stage.initOwner(Main.stage);
		stage.show();
		MinecraftAuthController controller = fxmlLoader.getController();
		controller.stage = stage;
		controller.buttonLogin.setDefaultButton(true);
		controller.showLoginGui();
	} catch (Exception e) {
		OneClientLogging.error(e);
	}
}
 
开发者ID:HearthProject,项目名称:OneClient,代码行数:33,代码来源:MinecraftAuthController.java

示例4: getInstallDir

import javafx.fxml.JavaFXBuilderFactory; //导入依赖的package包/类
public static void getInstallDir(Predicate<File> predicate) throws IOException {
	ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
	URL fxmlUrl = classLoader.getResource("gui/install_location.fxml");
	if (fxmlUrl == null) {
		OneClientLogging.logger.error("An error has occurred loading the fxml!");
	}
	FXMLLoader fxmlLoader = new FXMLLoader();
	fxmlLoader.setLocation(fxmlUrl);
	fxmlLoader.setBuilderFactory(new JavaFXBuilderFactory());
	Parent root = fxmlLoader.load(fxmlUrl.openStream());
	Stage stage = new Stage();
	stage.setTitle("Select Install Location");
	stage.getIcons().add(new Image("images/icon.png"));
	stage.setResizable(false);
	stage.initOwner(Main.stage);
	stage.initModality(Modality.WINDOW_MODAL);
	Scene scene = new Scene(root, 500, 150);
	scene.getStylesheets().add("gui/css/theme.css");
	stage.setScene(scene);
	stage.show();
	InstallLocation controller = fxmlLoader.getController();
	controller.okButton.setOnAction(event -> {
		predicate.test(new File(controller.locationField.getText()));
		stage.close();
	});
	controller.browseButton.setOnAction(event -> {
		DirectoryChooser directoryChooser = new DirectoryChooser();
		File dir = new File(controller.locationField.getText());
		if (dir.exists())
			directoryChooser.setInitialDirectory(dir);
		File selectedDirectory = directoryChooser.showDialog(stage);
		if (selectedDirectory != null) {
			controller.locationField.setText(selectedDirectory.getAbsolutePath());
		}
	});
	controller.locationField.setText(Constants.getDefaultDir().getAbsolutePath());
}
 
开发者ID:HearthProject,项目名称:OneClient,代码行数:38,代码来源:InstallLocation.java

示例5: show

import javafx.fxml.JavaFXBuilderFactory; //导入依赖的package包/类
public static void show() throws IOException {
	ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
	URL fxmlUrl = classLoader.getResource("gui/splash.fxml");
	if (fxmlUrl == null) {
		OneClientLogging.logger.error("An error has occurred loading instance_creation.fxml!");
		return;
	}
	FXMLLoader fxmlLoader = new FXMLLoader();
	fxmlLoader.setLocation(fxmlUrl);
	fxmlLoader.setBuilderFactory(new JavaFXBuilderFactory());
	Parent root = fxmlLoader.load(fxmlUrl.openStream());
	stage = new Stage();
	stage.setTitle("One Client - Loading");
	stage.getIcons().add(new Image("images/icon.png"));
	stage.setResizable(false);
	stage.initOwner(Main.stage);
	stage.initModality(Modality.WINDOW_MODAL);
	Scene scene = new Scene(root, 600, 400);
	scene.getStylesheets().add("gui/css/theme.css");
	stage.setScene(scene);
	splashScreenController = fxmlLoader.getController();
	stage.show();
	loaded = true;
}
 
开发者ID:HearthProject,项目名称:OneClient,代码行数:25,代码来源:SplashScreen.java

示例6: setupLogController

import javafx.fxml.JavaFXBuilderFactory; //导入依赖的package包/类
public static void setupLogController() {
	try {
		ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
		URL fxmlUrl = classLoader.getResource("gui/log.fxml");
		if (fxmlUrl == null) {
			OneClientLogging.logger.error("An error has occurred loading instance_creation.fxml!");
			return;
		}
		FXMLLoader fxmlLoader = new FXMLLoader();
		fxmlLoader.setLocation(fxmlUrl);
		fxmlLoader.setBuilderFactory(new JavaFXBuilderFactory());
		Parent root = fxmlLoader.load(fxmlUrl.openStream());
		stage = new Stage();
		stage.setTitle("One Client - Log");
		stage.getIcons().add(new Image("images/icon.png"));
		stage.setResizable(true);
		stage.setAlwaysOnTop(false);
		stage.initOwner(Main.stage);
		stage.initModality(Modality.NONE);
		Scene scene = new Scene(root, 600, 300);
		scene.getStylesheets().add("gui/css/theme.css");
		stage.setScene(scene);
		logController = fxmlLoader.getController();
		logController.setStage(stage);
		TextAreaAppender.setTextArea(logController.logArea);
	} catch (Exception e) {
		OneClientLogging.error(e);
	}
}
 
开发者ID:HearthProject,项目名称:OneClient,代码行数:30,代码来源:OneClientLogging.java

示例7: QueryPanePresentation

import javafx.fxml.JavaFXBuilderFactory; //导入依赖的package包/类
public QueryPanePresentation() {
    final URL location = this.getClass().getResource("QueryPanePresentation.fxml");

    final FXMLLoader fxmlLoader = new FXMLLoader();
    fxmlLoader.setLocation(location);
    fxmlLoader.setBuilderFactory(new JavaFXBuilderFactory());

    try {
        fxmlLoader.setRoot(this);
        fxmlLoader.load(location.openStream());

        controller = fxmlLoader.getController();

        initializeLeftBorder();
        initializeToolbar();
        initializeBackground();
        initializeAddQueryButton();

    } catch (final IOException ioe) {
        throw new IllegalStateException(ioe);
    }
}
 
开发者ID:ulriknyman,项目名称:H-Uppaal,代码行数:23,代码来源:QueryPanePresentation.java

示例8: MessagePresentation

import javafx.fxml.JavaFXBuilderFactory; //导入依赖的package包/类
public MessagePresentation(final CodeAnalysis.Message message) {
    this.message = message;

    final URL location = this.getClass().getResource("MessagePresentation.fxml");

    final FXMLLoader fxmlLoader = new FXMLLoader();
    fxmlLoader.setLocation(location);
    fxmlLoader.setBuilderFactory(new JavaFXBuilderFactory());

    try {
        fxmlLoader.setRoot(this);
        fxmlLoader.load(location.openStream());

        // Initialize
        initializeMessage();
        initializeNearLabel();

    } catch (final IOException ioe) {
        throw new IllegalStateException(ioe);
    }
}
 
开发者ID:ulriknyman,项目名称:H-Uppaal,代码行数:22,代码来源:MessagePresentation.java

示例9: BackgroundThreadEntryPresentation

import javafx.fxml.JavaFXBuilderFactory; //导入依赖的package包/类
public BackgroundThreadEntryPresentation(final Thread thread) {
    this.thread = thread;

    final URL location = this.getClass().getResource("BackgroundThreadEntryPresentation.fxml");

    final FXMLLoader fxmlLoader = new FXMLLoader();
    fxmlLoader.setLocation(location);
    fxmlLoader.setBuilderFactory(new JavaFXBuilderFactory());

    try {
        fxmlLoader.setRoot(this);
        fxmlLoader.load(location.openStream());

        initializeRippler();
        initializeBackground();
        initializeLabel();
        initializeThreadRunningCheck();

    } catch (final IOException ioe) {
        throw new IllegalStateException(ioe);
    }
}
 
开发者ID:ulriknyman,项目名称:H-Uppaal,代码行数:23,代码来源:BackgroundThreadEntryPresentation.java

示例10: ProjectPanePresentation

import javafx.fxml.JavaFXBuilderFactory; //导入依赖的package包/类
public ProjectPanePresentation() {
    final URL location = this.getClass().getResource("ProjectPanePresentation.fxml");

    final FXMLLoader fxmlLoader = new FXMLLoader();
    fxmlLoader.setLocation(location);
    fxmlLoader.setBuilderFactory(new JavaFXBuilderFactory());

    try {
        fxmlLoader.setRoot(this);
        fxmlLoader.load(location.openStream());

        controller = fxmlLoader.getController();

        initializeRightBorder();
        initializeBackground();
        initializeToolbar();

        initializeToolbarButton(controller.createComponent);

    } catch (final IOException ioe) {
        throw new IllegalStateException(ioe);
    }
}
 
开发者ID:ulriknyman,项目名称:H-Uppaal,代码行数:24,代码来源:ProjectPanePresentation.java

示例11: QueryPresentation

import javafx.fxml.JavaFXBuilderFactory; //导入依赖的package包/类
public QueryPresentation(final Query query) {
    final URL location = this.getClass().getResource("QueryPresentation.fxml");

    final FXMLLoader fxmlLoader = new FXMLLoader();
    fxmlLoader.setLocation(location);
    fxmlLoader.setBuilderFactory(new JavaFXBuilderFactory());

    try {
        fxmlLoader.setRoot(this);
        fxmlLoader.load(location.openStream());

        this.query = query;

        initializeStateIndicator();
        initializeProgressIndicator();
        initializeActionButton();
        initializeDetailsButton();
        initializeTextFields();

    } catch (final IOException ioe) {
        throw new IllegalStateException(ioe);
    }
}
 
开发者ID:ulriknyman,项目名称:H-Uppaal,代码行数:24,代码来源:QueryPresentation.java

示例12: MessageCollectionPresentation

import javafx.fxml.JavaFXBuilderFactory; //导入依赖的package包/类
public MessageCollectionPresentation(final Component component, final ObservableList<CodeAnalysis.Message> messages) {
    this.messages = messages;

    final URL location = this.getClass().getResource("MessageCollectionPresentation.fxml");

    final FXMLLoader fxmlLoader = new FXMLLoader();
    fxmlLoader.setLocation(location);
    fxmlLoader.setBuilderFactory(new JavaFXBuilderFactory());

    try {
        fxmlLoader.setRoot(this);
        fxmlLoader.load(location.openStream());

        initializeHeadline(component);
        initializeLine();
        initializeErrorsListener();


    } catch (final IOException ioe) {
        throw new IllegalStateException(ioe);
    }
}
 
开发者ID:ulriknyman,项目名称:H-Uppaal,代码行数:23,代码来源:MessageCollectionPresentation.java

示例13: TagPresentation

import javafx.fxml.JavaFXBuilderFactory; //导入依赖的package包/类
public TagPresentation() {
    final URL location = this.getClass().getResource("TagPresentation.fxml");

    final FXMLLoader fxmlLoader = new FXMLLoader();
    fxmlLoader.setLocation(location);
    fxmlLoader.setBuilderFactory(new JavaFXBuilderFactory());

    try {
        fxmlLoader.setRoot(this);
        fxmlLoader.load(location.openStream());

        initializeShape();
        initializeLabel();
        initializeMouseTransparency();
        initializeTextFocusHandler();

    } catch (final IOException ioe) {
        throw new IllegalStateException(ioe);
    }
}
 
开发者ID:ulriknyman,项目名称:H-Uppaal,代码行数:21,代码来源:TagPresentation.java

示例14: FilePresentation

import javafx.fxml.JavaFXBuilderFactory; //导入依赖的package包/类
public FilePresentation(final Component component) {
    final URL location = this.getClass().getResource("FilePresentation.fxml");

    final FXMLLoader fxmlLoader = new FXMLLoader();
    fxmlLoader.setLocation(location);
    fxmlLoader.setBuilderFactory(new JavaFXBuilderFactory());

    try {
        fxmlLoader.setRoot(this);
        fxmlLoader.load(location.openStream());

        this.component.set(component);

        initializeIcon();
        initializeFileName();
        initializeColors();
        initializeRippler();
        initializeMoreInformationButton();

    } catch (final IOException ioe) {
        throw new IllegalStateException(ioe);
    }
}
 
开发者ID:ulriknyman,项目名称:H-Uppaal,代码行数:24,代码来源:FilePresentation.java

示例15: createScene

import javafx.fxml.JavaFXBuilderFactory; //导入依赖的package包/类
private void createScene() {
    try {
        URL location = getClass().getResource("/fxml/photoviewer.fxml");
        FXMLLoader fxmlLoader = new FXMLLoader();
        fxmlLoader.setLocation(location);
        fxmlLoader.setBuilderFactory(new JavaFXBuilderFactory());

        Parent root = (Parent) fxmlLoader.load(location.openStream());
        Scene scene = new Scene(root);
        fxPanel.setScene(scene);
        controller = (PhotoViewerController) fxmlLoader.getController();
        controller.setPhoto(photo);
    } catch (IOException ex) {
        LOGGER.log(Level.SEVERE, null, ex);
    }
}
 
开发者ID:PacktPublishing,项目名称:Java-9-Programming-Blueprints,代码行数:17,代码来源:PhotoViewerTopComponent.java


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