<commit_before>package ch.unibas.dmi.dbis.reqman.ui;

import javafx.application.Application;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.control.*;
import javafx.scene.layout.GridPane;
import javafx.scene.text.Text;
import javafx.stage.Screen;
import javafx.stage.Stage;

/**
 * A sandbox
 */
public class GraphicalUI extends Application {

    public static void main(String[] args) {
        launch(args);
    }

    @Override
    public void start(Stage primaryStage) {
        primaryStage.setTitle("Requirement Manager");

        GridPane grid = new GridPane();
        grid.setAlignment(Pos.CENTER);
        grid.setHgap(10);
        grid.setVgap(10);
        grid.setPadding(new Insets(25,25,25,25));
        // TODO: Reslution and stuff
        Scene scene = new Scene(grid, 800, 600);

        primaryStage.setScene(scene);
        Text scenetitle = new Text("Test");
        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 info = new Label("Bounds: ");
        grid.add(info, 0, 2);
        TextField infoBounds = new TextField();
        infoBounds.setEditable(false);
        Screen primary = Screen.getPrimary();
        infoBounds.setText(primary.getVisualBounds().toString() );
        grid.add(infoBounds, 1, 2);
        Button button = new Button("Exit");
        grid.add(button, 1, 3);
        button.setOnAction((event) -> {
            System.exit(0);
        });



        primaryStage.show();
    }

    private Scene createRequirementPropertiesScene(){
        GridPane grid = new GridPane();
        grid.setAlignment(Pos.CENTER);
        grid.setHgap(10);
        grid.setVgap(10);

        Scene scene = new Scene(grid);

        Label lblName = new Label("Name");
        Label lblDesc = new Label("Description");
        Label lblMinMS = new Label("Minimal Milestone");
        Label lblMaxMS = new Label("Maximal Milestone");
        Label lblMaxPoints = new Label("Maximal Points");
        Label lblBinary = new Label("Binary");
        Label lblMandatory = new Label("Mandaotry");
        Label lblMalus = new Label("Malus");
        Label lblPredecessors = new Label("Predecessors");
        Label lblProps = new Label("Properties");

        TextField tfName = new TextField();
        TextArea taDesc = new TextArea();

        ChoiceBox<String> cbMinMS = new ChoiceBox<>(); // May be ComboBox
        ObservableList<String> list = FXCollections.observableArrayList("Create new...", "Milestone1", "Milestone2");
        cbMinMS.setItems(list);
        ChoiceBox<String> cbMaxMS = new ChoiceBox<>();
        cbMaxMS.setItems(list); // NOTE: This is intentionally the same list

        TextField tfPoints = new TextField();


        Button saveButton = new Button("Save");
        Button cancleButton = new Button("Cancle");

        grid.add(lblName, 0,0);
        grid.add(tfName, 1,0);
        grid.add(lblDesc, 0,1,0,1);
        // Skip one row
        

        return scene;
    }
}<commit_msg>Further progress on Requirement Properties dialog<commit_after>package ch.unibas.dmi.dbis.reqman.ui;

import javafx.application.Application;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.control.*;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.GridPane;
import javafx.scene.layout.HBox;
import javafx.scene.layout.Priority;
import javafx.scene.text.Text;
import javafx.stage.Screen;
import javafx.stage.Stage;

/**
 * A sandbox
 */
public class GraphicalUI extends Application {

    public static void main(String[] args) {
        launch(args);
    }

    @Override
    public void start(Stage primaryStage) {
        primaryStage.setTitle("Requirement Manager");

        primaryStage.setScene(createRequirementPropertiesScene() );

        primaryStage.show();
    }

    private Scene createRequirementPropertiesScene(){
        GridPane grid = new GridPane();
        grid.setAlignment(Pos.CENTER);
        grid.setStyle("-fx-padding: 10px; -fx-spacing: 10px; -fx-hgap: 10px;-fx-vgap: 10px");

        Scene scene = new Scene(grid);

        Label lblName = new Label("Name");
        Label lblDesc = new Label("Description");
        Label lblMinMS = new Label("Minimal Milestone");
        Label lblMaxMS = new Label("Maximal Milestone");
        Label lblMaxPoints = new Label("Maximal Points");
        Label lblBinary = new Label("Binary");
        Label lblMandatory = new Label("Mandatory");
        Label lblMalus = new Label("Malus");
        Label lblPredecessors = new Label("Predecessors");
        Label lblProps = new Label("Properties");

        TextField tfName = new TextField();
        TextArea taDesc = new TextArea();

        ComboBox<String> cbMinMS = new ComboBox<>(); // May be ComboBox
        ObservableList<String> list = FXCollections.observableArrayList("Create new...", "Milestone1", "Milestone2");
        cbMinMS.setItems(list);
        ComboBox<String> cbMaxMS = new ComboBox<>();
        cbMaxMS.setItems(list); // NOTE: This is intentionally the same list

        Spinner<Double> spinnerPoints = new Spinner(0d, Double.MAX_VALUE, 0.0);
        spinnerPoints.setEditable(true);


        Button saveButton = new Button("Save");
        Button cancelButton = new Button("Cancel");
        HBox buttons = new HBox();
        buttons.setStyle("-fx-padding: 5px; -fx-spacing: 5px");
        buttons.getChildren().addAll(saveButton, cancelButton);
        AnchorPane buttonWrapper = new AnchorPane();
        buttonWrapper.getChildren().add(buttons);
        AnchorPane.setRightAnchor(buttons, 0d);

        // TODO: Fix radioButtonGroups

        HBox binaryGroup = new HBox();
        binaryGroup.setStyle("-fx-spacing: 10px");
        ToggleGroup binaryButtons = new ToggleGroup();
        RadioButton binaryYes = new RadioButton("Yes");
        binaryYes.setToggleGroup(binaryButtons);
        RadioButton binaryNo = new RadioButton("No");
        binaryNo.setToggleGroup(binaryButtons);
        binaryNo.setSelected(true);
        binaryGroup.getChildren().addAll(lblBinary, binaryYes, binaryNo);


        HBox mandatoryGroup = new HBox();
        mandatoryGroup.setStyle("-fx-spacing: 10px");
        ToggleGroup mandatoryButtons = new ToggleGroup();
        RadioButton mandatoryYes = new RadioButton("Yes");
        mandatoryYes.setToggleGroup(mandatoryButtons);
        RadioButton mandatoryNo = new RadioButton("No");
        mandatoryNo.setToggleGroup(mandatoryButtons);
        mandatoryNo.setSelected(true);
        mandatoryGroup.getChildren().addAll(lblMandatory, mandatoryYes, mandatoryNo);


        HBox malusGroup = new HBox();
        malusGroup.setStyle("-fx-spacing: 10px");
        ToggleGroup malusButtons = new ToggleGroup();
        RadioButton malusYes = new RadioButton("Yes");
        malusYes.setToggleGroup(malusButtons);
        RadioButton malusNo = new RadioButton("No");
        malusNo.setToggleGroup(malusButtons);
        malusNo.setSelected(true);
        malusGroup.getChildren().addAll(lblMalus, malusYes, malusNo);

        GridPane groupWrapper = new GridPane();
        groupWrapper.setPadding(new Insets(0,10,0,10));
        groupWrapper.add(binaryGroup, 0,0);
        GridPane.setHgrow(binaryGroup, Priority.ALWAYS);
        groupWrapper.add(mandatoryGroup, 1,0);
        GridPane.setHgrow(mandatoryGroup, Priority.ALWAYS);
        groupWrapper.add(malusGroup, 2,0);
        GridPane.setHgrow(malusGroup, Priority.ALWAYS);

        int rowIndex = 0;

        grid.add(lblName, 0,rowIndex);
        grid.add(tfName, 1,rowIndex++);

        grid.add(lblDesc, 0,rowIndex);
        grid.add(taDesc, 1,rowIndex,1,2);
        rowIndex += 2;
        // Skip two rows
        grid.add(lblMinMS, 0, rowIndex);
        grid.add(cbMinMS, 1, rowIndex++);

        grid.add(lblMaxMS, 0, rowIndex);
        grid.add(cbMaxMS, 1,rowIndex++);

        grid.add(lblMaxPoints, 0, rowIndex);
        grid.add(spinnerPoints, 1,rowIndex++);
        // separator
        grid.add(new Separator(), 0,rowIndex++,2,1);
        // RadioButton groups
        grid.add(groupWrapper, 0, rowIndex++, 2, 1);
        GridPane.setHgrow(groupWrapper, Priority.ALWAYS);
        // Separator
        grid.add(new Separator(), 0,rowIndex++,2,1);

        grid.add(lblPredecessors, 0, rowIndex);
        grid.add(new Label("Predecessor list or so"), 1, rowIndex++);


        // Buttons, last row
        grid.add(buttonWrapper, 1, ++rowIndex, 2, 1);

        return scene;
    }
}
{'fraction_non_alphanumeric': 0.12143826322930801, 'fraction_numerical': 0.012324739936680235, 'mean_word_length': 2.918918918918919, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7390861', 'n_tokens_mistral': 2710, 'n_tokens_neox': 2572, 'n_words': 574}