Search in sources :

Example 56 with AnchorPane

use of javafx.scene.layout.AnchorPane in project jphp by jphp-compiler.

the class UXForm method __construct.

@Signature
public void __construct(@Nullable Stage stage) {
    __wrappedObject = stage == null ? new Stage() : stage;
    AnchorPane layout = new AnchorPane();
    Scene scene = new Scene(layout);
    getWrappedObject().setScene(scene);
}
Also used : Scene(javafx.scene.Scene) AnchorPane(javafx.scene.layout.AnchorPane)

Example 57 with AnchorPane

use of javafx.scene.layout.AnchorPane in project JFoenix by jfoenixadmin.

the class PopupDemo method start.

@Override
public void start(Stage primaryStage) throws Exception {
    JFXHamburger show = new JFXHamburger();
    show.setPadding(new Insets(10, 5, 10, 5));
    JFXRippler rippler = new JFXRippler(show, RipplerMask.CIRCLE, RipplerPos.BACK);
    JFXListView<Label> list = new JFXListView<>();
    for (int i = 1; i < 5; i++) {
        list.getItems().add(new Label("Item " + i));
    }
    AnchorPane container = new AnchorPane();
    container.getChildren().add(rippler);
    AnchorPane.setLeftAnchor(rippler, 200.0);
    AnchorPane.setTopAnchor(rippler, 210.0);
    StackPane main = new StackPane();
    main.getChildren().add(container);
    JFXPopup popup = new JFXPopup(list);
    rippler.setOnMouseClicked(e -> popup.show(rippler, PopupVPosition.TOP, PopupHPosition.LEFT));
    final Scene scene = new Scene(main, 800, 800);
    scene.getStylesheets().add(PopupDemo.class.getResource("/css/jfoenix-components.css").toExternalForm());
    primaryStage.setTitle("JFX Popup Demo");
    primaryStage.setScene(scene);
    primaryStage.setResizable(false);
    primaryStage.show();
}
Also used : JFXPopup(com.jfoenix.controls.JFXPopup) Insets(javafx.geometry.Insets) JFXRippler(com.jfoenix.controls.JFXRippler) JFXHamburger(com.jfoenix.controls.JFXHamburger) Label(javafx.scene.control.Label) JFXListView(com.jfoenix.controls.JFXListView) Scene(javafx.scene.Scene) AnchorPane(javafx.scene.layout.AnchorPane) StackPane(javafx.scene.layout.StackPane)

Example 58 with AnchorPane

use of javafx.scene.layout.AnchorPane in project BachelorPraktikum by lucasbuschlinger.

the class ConflictedLocations method initRootLayout.

/**
 * Initiates the view.
 */
private void initRootLayout() {
    try {
        FXMLLoader loader = new FXMLLoader(getClass().getClassLoader().getResource("views/ConflictView.fxml"));
        AnchorPane rootLayout = (AnchorPane) loader.load();
        Scene scene = new Scene(rootLayout);
        primaryStage.setScene(scene);
        primaryStage.show();
    } catch (IOException e) {
        e.printStackTrace();
    }
}
Also used : IOException(java.io.IOException) Scene(javafx.scene.Scene) FXMLLoader(javafx.fxml.FXMLLoader) AnchorPane(javafx.scene.layout.AnchorPane)

Example 59 with AnchorPane

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

the class RightsManagmentController method openOperatorManagment.

/**
 * This open a Stage to edit the {@link Operator} if the {@link Operator} is not null, if is null it will be a creation of a {@link Operator}.
 * <p>
 * @param op is the {@link Operator} which is edited, can be null to create a new.
 */
private void openOperatorManagment(Operator op) {
    try {
        FXMLLoader fxmlLoader = new FXMLLoader();
        AnchorPane page = (AnchorPane) fxmlLoader.load(getClass().getResource("OperatorManagmentView.fxml").openStream());
        OperatorManagmentController controller = (OperatorManagmentController) fxmlLoader.getController();
        controller.setOperator(op);
        Stage stage = new Stage();
        stage.setTitle("Nutzer Managment");
        Scene scene = new Scene(page, Color.ALICEBLUE);
        stage.setScene(scene);
        stage.showAndWait();
    } 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 60 with AnchorPane

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

the class TrexApp method start.

@Override
public void start(Stage stage) throws Exception {
    speedupTooltip();
    primaryStage = stage;
    FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("/fxml/MainView.fxml"));
    AnchorPane page = fxmlLoader.load();
    MainViewController mainviewcontroller = fxmlLoader.getController();
    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(780);
    stage.setMinHeight(700);
    stage.getIcons().add(new Image("/icons/trex.png"));
    packetBuilderAppController = injector.getInstance(AppController.class);
    PreferencesManager.getInstance().setPacketEditorConfigurations(packetBuilderAppController.getConfigurations());
    packetBuilderAppController.registerEventBusHandler(mainviewcontroller);
    stage.show();
}
Also used : MainViewController(com.exalttech.trex.ui.controllers.MainViewController) AppController(com.xored.javafx.packeteditor.controllers.AppController) Scene(javafx.scene.Scene) Image(javafx.scene.image.Image) FXMLLoader(javafx.fxml.FXMLLoader) AnchorPane(javafx.scene.layout.AnchorPane)

Aggregations

AnchorPane (javafx.scene.layout.AnchorPane)64 IOException (java.io.IOException)26 FXMLLoader (javafx.fxml.FXMLLoader)22 Scene (javafx.scene.Scene)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 URL (java.net.URL)13 Pane (javafx.scene.layout.Pane)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