Search in sources :

Example 26 with AnchorPane

use of javafx.scene.layout.AnchorPane in project RIS-PACS by KyleRemil.

the class FrameController method logOut.

public void logOut() {
    System.out.println("Logging out.");
    Context.getInstance().setRole(1);
    Context.getInstance().setStaffId(0);
    Context.getInstance().setStaffName("");
    Context.getInstance().setUserName("");
    try {
        AnchorPane root = FXMLLoader.load(getClass().getResource("../view/LoginView.fxml"));
        Stage stage = (Stage) tabPane.getScene().getWindow();
        Scene scene = new Scene(root);
        stage.setScene(scene);
    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
}
Also used : Stage(javafx.stage.Stage) IOException(java.io.IOException) Scene(javafx.scene.Scene) AnchorPane(javafx.scene.layout.AnchorPane)

Example 27 with AnchorPane

use of javafx.scene.layout.AnchorPane in project uPMT by coco35700.

the class RootLayoutController method aboutUs.

@FXML
public void aboutUs() {
    Stage helpWindow = new Stage(StageStyle.UTILITY);
    helpWindow.setTitle(main._langBundle.getString("about_us"));
    helpWindow.setResizable(false);
    // helpWindow.setAlwaysOnTop(true);
    helpWindow.initModality(Modality.APPLICATION_MODAL);
    try {
        FXMLLoader loader = new FXMLLoader();
        loader.setLocation(getClass().getResource("/view/HelpView.fxml"));
        loader.setController(new AboutController(main, helpWindow));
        // loader.setController(new HelpController(main, helpWindow, this.document));
        loader.setResources(main._langBundle);
        AnchorPane layout = (AnchorPane) loader.load();
        Scene sc = new Scene(layout);
        helpWindow.setScene(sc);
        helpWindow.showAndWait();
    } catch (IOException e) {
        // TODO Exit Program
        e.printStackTrace();
    }
}
Also used : Stage(javafx.stage.Stage) IOException(java.io.IOException) Scene(javafx.scene.Scene) FXMLLoader(javafx.fxml.FXMLLoader) AnchorPane(javafx.scene.layout.AnchorPane) FXML(javafx.fxml.FXML)

Example 28 with AnchorPane

use of javafx.scene.layout.AnchorPane in project dwoss by gg-net.

the class RightsManagmentController method openPersonaManagment.

/**
 * Open a Stage in which the given {@link Persona} is edit if the {@link Persona} is not null, if is null it will be a creation of a {@link Persona}.
 * <p>
 * @param p is the {@link Persona} which is edited, can be null to create a new.
 */
private void openPersonaManagment(Persona p) {
    try {
        FXMLLoader fxmlLoader = new FXMLLoader();
        AnchorPane page = (AnchorPane) fxmlLoader.load(getClass().getResource("PersonaManagmentView.fxml").openStream());
        PersonaManagmentController controller = (PersonaManagmentController) fxmlLoader.getController();
        controller.setPersona(p);
        Stage stage = new Stage();
        stage.setTitle("Rollen Managment");
        Scene scene = new Scene(page, Color.ALICEBLUE);
        stage.setScene(scene);
        stage.showAndWait();
        resetDeactivePersonas();
        resetDeactiveRights();
        resetAllRights();
    } catch (IOException ex) {
        Ui.handle(ex);
    }
}
Also used : Stage(javafx.stage.Stage) IOException(java.io.IOException) Scene(javafx.scene.Scene) AnchorPane(javafx.scene.layout.AnchorPane)

Example 29 with AnchorPane

use of javafx.scene.layout.AnchorPane in project trex-stateless-gui by cisco-system-traffic-generator.

the class UIBaseTest method start.

@Override
public void start(Stage stage) throws Exception {
    TrexApp.setPrimaryStage(stage);
    AnchorPane page = (AnchorPane) FXMLLoader.load(getClass().getResource("/fxml/MainView.fxml"));
    Scene scene = new Scene(page);
    scene.getStylesheets().add(TrexApp.class.getResource("/styles/mainStyle.css").toExternalForm());
    stage.setScene(scene);
    stage.setTitle("TRex");
    stage.setResizable(true);
    stage.setMinWidth(1100);
    stage.setMinHeight(670);
    stage.show();
}
Also used : Scene(javafx.scene.Scene) AnchorPane(javafx.scene.layout.AnchorPane)

Example 30 with AnchorPane

use of javafx.scene.layout.AnchorPane in project trex-stateless-gui by cisco-system-traffic-generator.

the class AbstractProtocolView method buildUI.

private void buildUI() {
    container = new AnchorPane();
    buildCustomProtocolView();
    setContent(container);
    if (dataBinding != null) {
        bindProperties();
    }
    addInputValidation();
}
Also used : AnchorPane(javafx.scene.layout.AnchorPane)

Aggregations

AnchorPane (javafx.scene.layout.AnchorPane)66 IOException (java.io.IOException)26 Scene (javafx.scene.Scene)23 FXMLLoader (javafx.fxml.FXMLLoader)22 ChangeListener (javafx.beans.value.ChangeListener)18 Label (javafx.scene.control.Label)16 ImageView (javafx.scene.image.ImageView)16 FXML (javafx.fxml.FXML)15 Insets (javafx.geometry.Insets)15 Pane (javafx.scene.layout.Pane)14 URL (java.net.URL)13 GridPane (javafx.scene.layout.GridPane)12 Inject (javax.inject.Inject)12 JFXButton (com.jfoenix.controls.JFXButton)11 ResourceBundle (java.util.ResourceBundle)11 KeyFrame (javafx.animation.KeyFrame)11 Timeline (javafx.animation.Timeline)11 Initializable (javafx.fxml.Initializable)11 Duration (javafx.util.Duration)11 Button (javafx.scene.control.Button)10