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();
}
}
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"));
}
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);
}
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();
}
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();
});
}
Aggregations