Search in sources :

Example 91 with GridPane

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

the class MomentExpVBox method loadMomentPane.

private void loadMomentPane() {
    sousMomentPane = new GridPane();
    try {
        FXMLLoader loader = new FXMLLoader();
        loader.setLocation(getClass().getResource("/view/MomentExperience.fxml"));
        loader.setController(this);
        momentPane = (BorderPane) loader.load();
    } catch (IOException e) {
        e.printStackTrace();
    }
}
Also used : GridPane(javafx.scene.layout.GridPane) IOException(java.io.IOException) FXMLLoader(javafx.fxml.FXMLLoader)

Example 92 with GridPane

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

the class StatsController method initialize.

@Override
public void initialize(URL location, ResourceBundle resources) {
    IStats.getInstance().update(main);
    GridPane statsGrid = new GridPane();
    statsGrid.setAlignment(Pos.CENTER);
    statsGrid.setHgap(25);
    statsGrid.setVgap(15);
    /* init columns */
    for (int i = 0; i < IStats.getInstance().getCategories().size(); i++) {
        Label l_cat = new Label(IStats.getCategories().get(i).getName());
        l_cat.setMinWidth(Region.USE_PREF_SIZE);
        l_cat.setMaxWidth(Region.USE_PREF_SIZE);
        statsGrid.setHalignment(l_cat, HPos.CENTER);
        statsGrid.add(l_cat, i + 1, 0);
    }
    /* init rows */
    for (int j = 0; j < IStats.getInstance().getInterviews().size(); j++) {
        Label l_int = new Label(IStats.getInterviews().get(j).getName());
        l_int.setMinWidth(Region.USE_PREF_SIZE);
        l_int.setMaxWidth(Region.USE_PREF_SIZE);
        statsGrid.setHalignment(l_int, HPos.CENTER);
        statsGrid.add(l_int, 0, j + 1);
    }
    /* set values of for each columns and rows */
    for (int i = 0; i < IStats.getInstance().getInterviews().size(); i++) {
        for (int j = 0; j < IStats.getInstance().getCategories().size(); j++) {
            int val = IStats.getInstance().nbOccurrences(IStats.getInstance().getInterviews().get(i), IStats.getInstance().getCategories().get(j));
            Label l_val = new Label(String.valueOf(val));
            statsGrid.setHalignment(l_val, HPos.CENTER);
            statsGrid.add(l_val, j + 1, i + 1);
        }
    }
    /* display all */
    this.centralPane.getChildren().add(statsGrid);
    buttonCloseStats.setText(main._langBundle.getString("close"));
}
Also used : GridPane(javafx.scene.layout.GridPane) Label(javafx.scene.control.Label)

Example 93 with GridPane

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

the class MainViewController method addGridPaneInterview.

public void addGridPaneInterview(DescriptionInterview d) {
    GridPane gp = new GridPane();
    gp.setMinHeight(200);
    gp.setPadding(new Insets(100, 0, 0, 0));
    addLinesToGrid(gp);
    main.setGrid(gp);
    MainViewTransformations.loadGridData(gp, main, d);
    interviewsPane.put(d, gp);
}
Also used : GridPane(javafx.scene.layout.GridPane) Insets(javafx.geometry.Insets)

Example 94 with GridPane

use of javafx.scene.layout.GridPane in project sandbox by irof.

the class Login method start.

@Override
public void start(Stage primaryStage) throws Exception {
    primaryStage.setTitle("JavaFX Welcome");
    GridPane grid = new GridPane();
    grid.setAlignment(Pos.CENTER);
    grid.setHgap(10);
    grid.setVgap(10);
    grid.setPadding(new Insets(25, 25, 25, 25));
    Text scenetitle = new Text("Welcome");
    scenetitle.setId("welcome-text");
    grid.add(scenetitle, 0, 0, 2, 1);
    Label userName = new Label("User Name:");
    grid.add(userName, 0, 1);
    TextField userTextField = new TextField();
    grid.add(userTextField, 1, 1);
    Label password = new Label("Password:");
    grid.add(password, 0, 2);
    PasswordField passwordField = new PasswordField();
    grid.add(passwordField, 1, 2);
    Button button = new Button("Sign in");
    HBox hBox = new HBox(10);
    hBox.setAlignment(Pos.BOTTOM_RIGHT);
    hBox.getChildren().add(button);
    grid.add(hBox, 1, 4);
    Text actionTarget = new Text();
    actionTarget.setId("actiontarget");
    grid.add(actionTarget, 1, 6);
    button.setOnAction(e -> {
        actionTarget.setText("Sign in button pressed");
    });
    Scene scene = new Scene(grid, 300, 275);
    scene.getStylesheets().add(Login.class.getResource("Login.css").toExternalForm());
    primaryStage.setScene(scene);
    primaryStage.show();
}
Also used : HBox(javafx.scene.layout.HBox) GridPane(javafx.scene.layout.GridPane) Insets(javafx.geometry.Insets) Button(javafx.scene.control.Button) Label(javafx.scene.control.Label) TextField(javafx.scene.control.TextField) Text(javafx.scene.text.Text) PasswordField(javafx.scene.control.PasswordField) Scene(javafx.scene.Scene)

Example 95 with GridPane

use of javafx.scene.layout.GridPane in project ethereum-ingest by codingchili.

the class Form method showAlertFromError.

public static void showAlertFromError(Throwable e) {
    Platform.runLater(() -> {
        Alert alert = new Alert(Alert.AlertType.ERROR);
        alert.initStyle(StageStyle.UTILITY);
        alert.setTitle("Error");
        alert.setContentText("An error has occured, submit an issue with the stack " + "trace if you need help.");
        alert.setHeaderText(null);
        TextArea textArea = new TextArea(throwableToString(e));
        textArea.setEditable(false);
        textArea.setMaxWidth(Double.MAX_VALUE);
        textArea.setMaxHeight(Double.MAX_VALUE);
        GridPane.setVgrow(textArea, Priority.ALWAYS);
        GridPane.setHgrow(textArea, Priority.ALWAYS);
        GridPane expContent = new GridPane();
        expContent.setMaxWidth(Double.MAX_VALUE);
        expContent.add(textArea, 0, 1);
        alert.getDialogPane().setExpandableContent(expContent);
        alert.getDialogPane().getStylesheets().add(Form.class.getResource(CSS_FILE).toExternalForm());
        alert.showAndWait();
    });
}
Also used : GridPane(javafx.scene.layout.GridPane) TextArea(javafx.scene.control.TextArea) Alert(javafx.scene.control.Alert)

Aggregations

GridPane (javafx.scene.layout.GridPane)147 Label (javafx.scene.control.Label)83 Insets (javafx.geometry.Insets)67 Button (javafx.scene.control.Button)46 TextField (javafx.scene.control.TextField)42 VBox (javafx.scene.layout.VBox)37 Scene (javafx.scene.Scene)36 HBox (javafx.scene.layout.HBox)26 ButtonType (javafx.scene.control.ButtonType)25 Text (javafx.scene.text.Text)24 Node (javafx.scene.Node)23 Dialog (javafx.scene.control.Dialog)23 ColumnConstraints (javafx.scene.layout.ColumnConstraints)18 Stage (javafx.stage.Stage)18 TextWithStyle (org.phoenicis.javafx.views.common.TextWithStyle)17 List (java.util.List)16 CheckBox (javafx.scene.control.CheckBox)16 ImageView (javafx.scene.image.ImageView)14 ActionEvent (javafx.event.ActionEvent)13 ComboBox (javafx.scene.control.ComboBox)13