本文整理汇总了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);
}
}
示例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;
}
示例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);
}
}
示例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;
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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();
}
}
示例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);
}
}
示例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();
}
示例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);
}
}