Search in sources :

Example 21 with FXMLLoader

use of javafx.fxml.FXMLLoader in project TeachingInSimulation by ScOrPiOzzy.

the class DialogPane method loadFXML.

private void loadFXML() {
    FXMLLoader loader = new FXMLLoader();
    URL fxmlUrl = this.getClass().getResource("/view/Dialog.fxml");
    loader.setLocation(fxmlUrl);
    loader.setController(this);
    loader.setRoot(this);
    loader.setResources(ResourceBundle.getBundle("i18n/messages"));
    try {
        loader.load();
        LOG.debug("加载FXML界面{}完成", fxmlUrl);
    } catch (IOException e) {
        e.printStackTrace();
        LOG.error("加载FXML界面{}失败,错误信息:{}", fxmlUrl, e.getMessage());
    }
}
Also used : IOException(java.io.IOException) FXMLLoader(javafx.fxml.FXMLLoader) URL(java.net.URL)

Example 22 with FXMLLoader

use of javafx.fxml.FXMLLoader in project TeachingInSimulation by ScOrPiOzzy.

the class ClassList method loadFXML.

/**
 * 加载界面布局文件
 */
private void loadFXML() {
    FXMLLoader loader = new FXMLLoader();
    URL fxmlUrl = this.getClass().getResource("/view/information/List.fxml");
    loader.setLocation(fxmlUrl);
    loader.setController(this);
    loader.setRoot(this);
    loader.setResources(ResourceBundle.getBundle("i18n/messages"));
    try {
        loader.load();
        LOG.debug("加载FXML界面{}完成", fxmlUrl);
    } catch (IOException e) {
        e.printStackTrace();
        LOG.error("加载FXML界面{}失败,错误信息:{}", fxmlUrl, e.getMessage());
    }
}
Also used : IOException(java.io.IOException) FXMLLoader(javafx.fxml.FXMLLoader) URL(java.net.URL)

Example 23 with FXMLLoader

use of javafx.fxml.FXMLLoader in project TeachingInSimulation by ScOrPiOzzy.

the class TeacherList method loadFXML.

/**
 * 加载界面布局文件
 */
private void loadFXML() {
    FXMLLoader loader = new FXMLLoader();
    URL fxmlUrl = this.getClass().getResource("/view/information/List.fxml");
    loader.setLocation(fxmlUrl);
    loader.setController(this);
    loader.setRoot(this);
    loader.setResources(ResourceBundle.getBundle("i18n/messages"));
    try {
        loader.load();
        LOG.debug("加载FXML界面{}完成", fxmlUrl);
    } catch (IOException e) {
        e.printStackTrace();
        LOG.error("加载FXML界面{}失败,错误信息:{}", fxmlUrl, e.getMessage());
    }
}
Also used : IOException(java.io.IOException) FXMLLoader(javafx.fxml.FXMLLoader) URL(java.net.URL)

Example 24 with FXMLLoader

use of javafx.fxml.FXMLLoader in project TeachingInSimulation by ScOrPiOzzy.

the class TypicalCaseBtnController method showDrawingWin.

@FXML
private void showDrawingWin(ActionEvent event) {
    ((Button) event.getSource()).setDisable(true);
    try {
        if (drawingWin == null) {
            drawingWin = new Stage();
            drawingWin.initStyle(StageStyle.TRANSPARENT);
            drawingWin.setX(GUIState.getStage().getX() + 100);
            drawingWin.setY(GUIState.getStage().getY() + 100);
            FXMLLoader loader = new FXMLLoader();
            loader.setResources(ResourceBundle.getBundle("i18n/messages"));
            Region root = loader.load(TypicalCaseBtnController.class.getResourceAsStream("/view/jme/Drawing.fxml"));
            DrawingController controller = loader.getController();
            controller.setStage(drawingWin);
            controller.setUI(typicalCase3D);
            Scene scene = new Scene(root);
            drawingWin.setScene(scene);
            drawingWin.setOnHidden(e -> {
                ((Button) event.getSource()).setDisable(false);
            });
        }
        drawingWin.show();
    } catch (IOException e) {
        e.printStackTrace();
    }
}
Also used : Button(javafx.scene.control.Button) Stage(javafx.stage.Stage) Region(javafx.scene.layout.Region) IOException(java.io.IOException) DrawingController(com.cas.sim.tis.view.controller.DrawingController) Scene(javafx.scene.Scene) FXMLLoader(javafx.fxml.FXMLLoader) FXML(javafx.fxml.FXML)

Example 25 with FXMLLoader

use of javafx.fxml.FXMLLoader in project TeachingInSimulation by ScOrPiOzzy.

the class PublishListForStudent method loadFXML.

/**
 * 加载界面布局文件
 */
private void loadFXML() {
    FXMLLoader loader = new FXMLLoader();
    URL fxmlUrl = this.getClass().getResource("/view/library/PublishList.fxml");
    loader.setLocation(fxmlUrl);
    loader.setController(this);
    loader.setRoot(this);
    loader.setResources(ResourceBundle.getBundle("i18n/messages"));
    try {
        loader.load();
        LOG.debug("加载FXML界面{}完成", fxmlUrl);
    } catch (IOException e) {
        e.printStackTrace();
        LOG.error("加载FXML界面{}失败,错误信息:{}", fxmlUrl, e.getMessage());
    }
}
Also used : IOException(java.io.IOException) FXMLLoader(javafx.fxml.FXMLLoader) URL(java.net.URL)

Aggregations

FXMLLoader (javafx.fxml.FXMLLoader)252 IOException (java.io.IOException)148 Scene (javafx.scene.Scene)120 Parent (javafx.scene.Parent)79 Stage (javafx.stage.Stage)64 FXML (javafx.fxml.FXML)46 URL (java.net.URL)43 Pane (javafx.scene.layout.Pane)34 BorderPane (javafx.scene.layout.BorderPane)30 AnchorPane (javafx.scene.layout.AnchorPane)24 ActionEvent (javafx.event.ActionEvent)19 ResourceBundle (java.util.ResourceBundle)16 Initializable (javafx.fxml.Initializable)14 JFXButton (com.jfoenix.controls.JFXButton)13 KeyFrame (javafx.animation.KeyFrame)13 Timeline (javafx.animation.Timeline)13 StackPane (javafx.scene.layout.StackPane)13 Duration (javafx.util.Duration)13 Level (java.util.logging.Level)12 Logger (java.util.logging.Logger)12