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


Java FXMLLoader.setBuilderFactory方法代码示例

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


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

示例1: MessagePresentation

import javafx.fxml.FXMLLoader; //导入方法依赖的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

示例2: getPane

import javafx.fxml.FXMLLoader; //导入方法依赖的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: TagPresentation

import javafx.fxml.FXMLLoader; //导入方法依赖的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

示例4: show

import javafx.fxml.FXMLLoader; //导入方法依赖的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

示例5: setupLogController

import javafx.fxml.FXMLLoader; //导入方法依赖的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

示例6: FilePresentation

import javafx.fxml.FXMLLoader; //导入方法依赖的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

示例7: BackgroundThreadEntryPresentation

import javafx.fxml.FXMLLoader; //导入方法依赖的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

示例8: createScene

import javafx.fxml.FXMLLoader; //导入方法依赖的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

示例9: ProjectPanePresentation

import javafx.fxml.FXMLLoader; //导入方法依赖的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

示例10: QueryPresentation

import javafx.fxml.FXMLLoader; //导入方法依赖的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

示例11: MessageCollectionPresentation

import javafx.fxml.FXMLLoader; //导入方法依赖的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

示例12: Page

import javafx.fxml.FXMLLoader; //导入方法依赖的package包/类
public Page(String title, PagePane pagePane) {
        this.setText(title);
        setClosable(true);
        tooltip=new Tooltip();
        tooltip.setText(title);
        tooltip.textProperty().bind(this.textProperty());
        try {
            StackPane headerArea = (StackPane) pagePane.lookup(".tab-header-area");

            URL location = getClass().getResource("/fxml/tab_content.fxml");

            FXMLLoader fxmlLoader = new FXMLLoader();
            fxmlLoader.setLocation(location);
            fxmlLoader.setBuilderFactory(new JavaFXBuilderFactory());
            Parent parent =  fxmlLoader.load(location.openStream());

//            FXMLLoader fxmlLoader=new FXMLLoader(Res.getFxmlRes("tab_content"));
//            Pane parent=fxmlLoader.load();
            setContent(parent);
            controller=fxmlLoader.getController();
            controller.getHeader().prefWidthProperty().bind(pagePane.widthProperty());
            controller.getContainer().prefWidthProperty().bind(pagePane.widthProperty());
            controller.getContainer().prefHeightProperty().bind(pagePane.heightProperty()
                    .subtract(headerArea.heightProperty())
                    .subtract(controller.getHeader().heightProperty()));
            this.setOnClosed(controller::close);
            controller.setTab(this);
            controller.setPagePane(pagePane);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
 
开发者ID:whitewoodcity,项目名称:xbrowser,代码行数:33,代码来源:Page.java

示例13: BackgroundThreadPresentation

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

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

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

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

示例14: startLauncher

import javafx.fxml.FXMLLoader; //导入方法依赖的package包/类
public void startLauncher() throws Exception {
	OneClientLogging.logger.info("Starting One Client");
	ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
	URL fxmlUrl = classLoader.getResource("gui/main.fxml");
	if (fxmlUrl == null) {
		OneClientLogging.logger.error("An error has occurred loading main.fxml!");
		return;
	}
	FXMLLoader fxmlLoader = new FXMLLoader();
	fxmlLoader.setLocation(fxmlUrl);
	fxmlLoader.setBuilderFactory(new JavaFXBuilderFactory());
	Parent root = fxmlLoader.load(fxmlUrl.openStream());
	if (Constants.getVersion() == null) {
		stage.setTitle("One Client");
	} else {
		stage.setTitle("One Client " + Constants.getVersion());
	}
	stage.getIcons().add(new Image("images/icon.png"));
	scene = new Scene(root, 1288, 800);
	scene.getStylesheets().add("gui/css/theme.css");
	stage.setScene(scene);
	stage.show();
	stage.setOnCloseRequest(event -> {
		OneClientLogging.stage.close();
		OneClientLogging.logger.info("Goodbye");
		System.exit(0);
	});
	mainController = fxmlLoader.getController();
	scene.widthProperty().addListener((observableValue, oldSceneWidth, newSceneWidth) -> mainController.onSceneResize(scene));
	scene.heightProperty().addListener((observableValue, oldSceneWidth, newSceneWidth) -> mainController.onSceneResize(scene));
	mainController.onStart(stage);
	MinecraftAuthController.load();
}
 
开发者ID:HearthProject,项目名称:OneClient,代码行数:34,代码来源:Main.java

示例15: LocationPresentation

import javafx.fxml.FXMLLoader; //导入方法依赖的package包/类
public LocationPresentation(final Location location, final Component component, final boolean interactable) {
    this.interactable = interactable;
    final URL url = this.getClass().getResource("LocationPresentation.fxml");

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

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

        controller = fxmlLoader.getController();

        // Bind the component with the one of the controller
        controller.setComponent(component);

        // Bind the location with the one of the controller
        controller.setLocation(location);

        controller.initializeInvalidNameError();

        initializeIdLabel();
        initializeTypeGraphics();
        initializeLocationShapes();
        initializeTags();
        initializeInitialAnimation();
        initializeHoverAnimationEntered();
        initializeHoverAnimationExited();
        initializeDeleteShakeAnimation();
        initializeShakeAnimation();
        initializeCircle();
        initializeReachabilityStyle();

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


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